Fix: remove .cue suffix from the component name of observability (#2796)

If the component name has a suffix `.cue`, it will hit issue of not
match a DNS name
This commit is contained in:
Zheng Xi Zhou
2021-11-25 11:06:08 +08:00
committed by GitHub
parent 40f100ec27
commit bbb1c1767e
+3
View File
@@ -501,6 +501,9 @@ func RenderApplication(addon *types.Addon, args map[string]interface{}) (*v1beta
if err != nil {
return nil, nil, ErrRenderCueTmpl
}
if addon.Name == "observability" && strings.HasSuffix(comp.Name, ".cue") {
comp.Name = strings.Split(comp.Name, ".cue")[0]
}
app.Spec.Components = append(app.Spec.Components, *comp)
}