common-helm-lib/templates/_configmaps.tpl
Jonas Forsberg 0fe6d615a0
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 14s
.
2024-10-22 14:29:12 +02:00

29 lines
727 B
Smarty

{{- define "lib.configs" -}}
{{- $fullName := include "lib.fullname" . -}}
{{- $namespace := .Values.namespace | default "default" -}}
{{- $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 -}}
{{- end -}}