_imagePullSecret.tpl 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{/* Image Pull Secrets Spawner */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.spawner.imagePullSecret" $ -}}
  4. */}}
  5. {{- define "ix.v1.common.spawner.imagePullSecret" -}}
  6. {{- range $name, $imgPullSecret := .Values.imagePullSecret -}}
  7. {{- if $imgPullSecret.enabled -}}
  8. {{/* Create a copy of the configmap */}}
  9. {{- $objectData := (mustDeepCopy $imgPullSecret) -}}
  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.imagePullSecret.validation" (dict "objectData" $objectData) -}}
  14. {{- include "ix.v1.common.lib.metadata.validation" (dict "objectData" $objectData "caller" "Image Pull Secret") -}}
  15. {{- $data := include "ix.v1.common.lib.imagePullSecret.createData" (dict "rootCtx" $ "objectData" $objectData) -}}
  16. {{/* Update the data */}}
  17. {{- $_ := set $objectData "data" $data -}}
  18. {{/* Set the type to Image Pull Secret */}}
  19. {{- $_ := set $objectData "type" "imagePullSecret" -}}
  20. {{/* Set the name of the image pull secret */}}
  21. {{- $_ := set $objectData "name" $objectName -}}
  22. {{- $_ := set $objectData "shortName" $name -}}
  23. {{/* Call class to create the object */}}
  24. {{- include "ix.v1.common.class.secret" (dict "rootCtx" $ "objectData" $objectData) -}}
  25. {{- end -}}
  26. {{- end -}}
  27. {{- end -}}