Fix: addon name should not add prefix resources (#2808)

* Fix: addon name should not add prefix `resources`

- Adding prefix `resources will hit issues as:
'unable to parse requirement: invalid label value:
"resources-prometheus-server-register-grafana-datasource-5576f7f6b4":
      at key: "controller.oam.dev/component": must be no more than 63 characters'
- This won't avoid the name confliction with other components

* address comments
This commit is contained in:
Zheng Xi Zhou
2021-11-25 21:01:56 +08:00
committed by GitHub
parent 2be261e3f7
commit 41f384e36b
+2 -2
View File
@@ -568,7 +568,7 @@ func renderNamespace(namespace string) *unstructured.Unstructured {
func renderRawComponent(elem types.AddonElementFile) (*common2.ApplicationComponent, error) {
baseRawComponent := common2.ApplicationComponent{
Type: "raw",
Name: strings.Join(append(elem.Path, elem.Name), "-"),
Name: elem.Name,
}
obj, err := renderObject(elem)
if err != nil {
@@ -606,7 +606,7 @@ func renderCUETemplate(elem types.AddonElementFile, parameters string, args map[
return nil, err
}
comp := common2.ApplicationComponent{
Name: strings.Join(append(elem.Path, elem.Name), "-"),
Name: elem.Name,
}
err = yaml.Unmarshal(b, &comp)
if err != nil {