I am trying to do merge of multiple values files which has array of secrets.But the merging is not working instead the last values file overrides. This is my secret template
---
{{- range .Values.secrets }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ required "a valid name is required" .name }}
namespace: ""
type: Opaque
data:
{{- range $key, $val := .data }}
# fix printing the key name in the required string
{{ $key }}: {{ required "a valid key is required" $val }}
{{- end }}
{{- end }}
value1.yaml:
secrets:
- name: "sample"
data:
test: "YXBpa2V5MQo="
value2.yaml:
- name: "sample2"
data:
test: "YXBpa2V5MQo="
helm template secrets-template -f value1.yaml -f value2.yaml
The output is
---
apiVersion: v1
kind: Secret
metadata:
name: sample2
namespace: ""
type: Opaque
data:
# fix printing the key name in the required string
test: YXBpa2V5MQo=
But the expected output is
---
apiVersion: v1
kind: Secret
metadata:
name: sample
namespace: ""
type: Opaque
data:
# fix printing the key name in the required string
test: YXBpa2V5MQo=
---
apiVersion: v1
kind: Secret
metadata:
name: sample2
namespace: ""
type: Opaque
data:
# fix printing the key name in the required string
test: YXBpa2V5MQo=
Any help on this ?