_configmap.tpl 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {{/* Configmap Spawwner */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.spawner.configmap" $ -}}
  4. */}}
  5. {{- define "ix.v1.common.spawner.configmap" -}}
  6. {{- range $name, $configmap := .Values.configmap -}}
  7. {{- if $configmap.enabled -}}
  8. {{/* Create a copy of the configmap */}}
  9. {{- $objectData := (mustDeepCopy $configmap) -}}
  10. {{- $objectName := (printf "%s-%s" (include "ix.v1.common.lib.chart.names.fullname" $) $name) -}}
  11. {{/* Perform validations */}}
  12. {{- include "ix.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}}
  13. {{- include "ix.v1.common.lib.configmap.validation" (dict "objectData" $objectData) -}}
  14. {{- include "ix.v1.common.lib.metadata.validation" (dict "objectData" $objectData "caller" "ConfigMap") -}}
  15. {{/* Set the name of the configmap */}}
  16. {{- $_ := set $objectData "name" $objectName -}}
  17. {{- $_ := set $objectData "shortName" $name -}}
  18. {{/* Call class to create the object */}}
  19. {{- include "ix.v1.common.class.configmap" (dict "rootCtx" $ "objectData" $objectData) -}}
  20. {{- end -}}
  21. {{- end -}}
  22. {{- end -}}