fix(schema): Use ingress default values
Ingress has some default values, like path and classname. We need to ensure that values are taken or nil, and to apply them if they are not set explicitally. Port is a sepcial case.
This commit is contained in:
@@ -107,6 +107,19 @@ func getLabelContent(o any, service *types.ServiceConfig, labelName string) erro
|
||||
return err
|
||||
}
|
||||
val := strings.TrimSpace(string(c))
|
||||
if labelName == labels.LabelIngress {
|
||||
// special case, values must be set from some defaults
|
||||
ing, err := labelStructs.IngressFrom(val)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
c, err := yaml.Marshal(ing)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
val = strings.TrimSpace(string(c))
|
||||
}
|
||||
|
||||
service.Labels[labelName] = val
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user