_enableServiceLinks.tpl 886 B

123456789101112131415161718192021222324
  1. {{/* Returns enableServiceLinks */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.pod.enableServiceLinks" (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.enableServiceLinks" -}}
  8. {{- $rootCtx := .rootCtx -}}
  9. {{- $objectData := .objectData -}}
  10. {{- $enableServiceLinks := false -}}
  11. {{/* Initialize from the "global" option */}}
  12. {{- if (kindIs "bool" $rootCtx.Values.podOptions.enableServiceLinks) -}}
  13. {{- $enableServiceLinks = $rootCtx.Values.podOptions.enableServiceLinks -}}
  14. {{- end -}}
  15. {{/* Override with pod's option */}}
  16. {{- if (kindIs "bool" $objectData.podSpec.enableServiceLinks) -}}
  17. {{- $enableServiceLinks = $objectData.podSpec.enableServiceLinks -}}
  18. {{- end -}}
  19. {{- $enableServiceLinks -}}
  20. {{- end -}}