20 lines
826 B
YAML
20 lines
826 B
YAML
{{- range $destination := $.Values.destinations }}
|
|
{{- if eq (include "secrets.shouldCreateKubernetesSecret" $destination ) "true" }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ include "secrets.kubernetesSecretName" (deepCopy $ | merge (dict "object" $destination)) | quote }}
|
|
namespace: {{ include "secrets.kubernetesSecretNamespace" (deepCopy $ | merge (dict "object" $destination)) | quote }}
|
|
type: Opaque
|
|
data:
|
|
{{- $secrets := include (printf "secrets.list.%s" $destination.type) . | fromYamlArray }}
|
|
{{- range $secret := $secrets }}
|
|
{{- $value := include "secrets.getSecretValue" (dict "object" $destination "key" $secret) -}}
|
|
{{- if $value }}
|
|
{{ include "secrets.getSecretKey" (dict "object" $destination "key" $secret) }}: {{ $value | b64enc | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- end -}}
|