mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
Copy over kah library
This commit is contained in:
parent
c922af6065
commit
61626834fe
57 changed files with 3583 additions and 0 deletions
34
charts/library/common/templates/classes/_configmap.tpl
Normal file
34
charts/library/common/templates/classes/_configmap.tpl
Normal file
|
@ -0,0 +1,34 @@
|
|||
{{/*
|
||||
This template serves as a blueprint for all configMap objects that are created
|
||||
within the common library.
|
||||
*/}}
|
||||
{{- define "common.classes.configmap" -}}
|
||||
{{- $fullName := include "common.names.fullname" . -}}
|
||||
{{- $configMapName := $fullName -}}
|
||||
{{- $values := .Values.configmap -}}
|
||||
|
||||
{{- if hasKey . "ObjectValues" -}}
|
||||
{{- with .ObjectValues.configmap -}}
|
||||
{{- $values = . -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||
{{- $configMapName = printf "%v-%v" $configMapName $values.nameOverride -}}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ $configMapName }}
|
||||
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||
labels: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||
annotations: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- with $values.data }}
|
||||
{{- tpl (toYaml .) $ | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue