diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 1fb5b085f0..8b2aeb61c3 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -75,9 +75,9 @@ func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { if err != nil { return nil, err } - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(v, ",")}) + keyValueContent, err = yaml.Marshal(map[string]interface{}{item.Name: v}) } else { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.GroupVersions, ",")}) + keyValueContent, err = yaml.Marshal(map[string]interface{}{item.Name: item.KubernetesAPIs.GroupVersions}) } default: return nil, fmt.Errorf("Invalid downward API item given") diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index d0aa2aa4af..f1386f0c18 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -198,7 +198,9 @@ allAnnotations: anotherExpectedAnnotation: anotherExpectedAnnotationValue kubernetesVersion: "1.0.0" kcVersion: "2.0.0" -k8sAPIs: "test/test,test2/test2" +k8sAPIs: +- test/test +- test2/test2 `, name, env.Namespace, uid) actual := cm.Data["values"] @@ -271,8 +273,8 @@ spec: kappControllerVersion: version: 2.0.0 - name: k8sAPIs - kubernetesAPIs: - kubernetesGroupVersions: + kubernetesAPIs: + groupVersions: - "test/test" - "test2/test2" deploy: @@ -319,7 +321,9 @@ namespace: "%s" uid: "%s" kubernetesVersion: "1.0.0" kcVersion: "2.0.0" -k8sAPIs: "test/test,test2/test2" +k8sAPIs: +- test/test +- test2/test2 `, name, env.Namespace, uid) configMapData, err := yaml.Marshal(cm.Data) require.NoError(t, err)