_autoMountServiceAccountToken.tpl 920 B

123456789101112131415161718192021222324
  1. {{/* Returns automountServiceAccountToken */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.pod.automountServiceAccountToken" (dict "rootCtx" $ "objectData" $objectData) }}
  4. rootCtx: The root context of the chart.
  5. objectData: The object data to be used to render the Pod.
  6. */}}
  7. {{- define "ix.v1.common.lib.pod.automountServiceAccountToken" -}}
  8. {{- $rootCtx := .rootCtx -}}
  9. {{- $objectData := .objectData -}}
  10. {{- $automount := false -}}
  11. {{/* Initialize from the "global" option */}}
  12. {{- if (kindIs "bool" $rootCtx.Values.podOptions.automountServiceAccountToken) -}}
  13. {{- $automount = $rootCtx.Values.podOptions.automountServiceAccountToken -}}
  14. {{- end -}}
  15. {{/* Override with pod's option */}}
  16. {{- if (kindIs "bool" $objectData.podSpec.automountServiceAccountToken) -}}
  17. {{- $automount = $objectData.podSpec.automountServiceAccountToken -}}
  18. {{- end -}}
  19. {{- $automount -}}
  20. {{- end -}}