Skip to content

Commit

Permalink
use array as type of values for kubernetesAPIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Kalinin committed Sep 7, 2022
1 parent 3d9f87f commit 43408dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/template/downward_api_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 8 additions & 4 deletions test/e2e/kappcontroller/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -271,8 +273,8 @@ spec:
kappControllerVersion:
version: 2.0.0
- name: k8sAPIs
kubernetesAPIs:
kubernetesGroupVersions:
kubernetesAPIs:
groupVersions:
- "test/test"
- "test2/test2"
deploy:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 43408dc

Please sign in to comment.