common-helm-lib/templates/_configmaps.tpl

29 lines
727 B
Smarty
Raw Normal View History

2024-10-18 05:57:53 +00:00
{{- define "lib.configs" -}}
{{- $fullName := include "lib.fullname" . -}}
2024-10-22 12:29:12 +00:00
{{- $namespace := .Values.namespace | default "default" -}}
2024-10-18 05:57:53 +00:00
{{- $commonLabels := include "lib.labels" . }}
{{- range $name, $values := .Values.configs }}
{{- if $values.enabled -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $fullName }}-{{ $name }}
namespace: {{ $namespace }}
labels:
{{- $commonLabels | nindent 4 }}
{{- with $values.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with $values.annotations }}
annotations:
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with $values.data }}
data:
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}
2024-10-18 14:24:24 +00:00
{{- end -}}