_cassandra.tpl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {{/*
  2. Copyright Broadcom, Inc. All Rights Reserved.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{/* vim: set filetype=mustache: */}}
  6. {{/*
  7. Auxiliary function to get the right value for existingSecret.
  8. Usage:
  9. {{ include "common.cassandra.values.existingSecret" (dict "context" $) }}
  10. Params:
  11. - subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
  12. */}}
  13. {{- define "common.cassandra.values.existingSecret" -}}
  14. {{- if .subchart -}}
  15. {{- .context.Values.cassandra.dbUser.existingSecret | quote -}}
  16. {{- else -}}
  17. {{- .context.Values.dbUser.existingSecret | quote -}}
  18. {{- end -}}
  19. {{- end -}}
  20. {{/*
  21. Auxiliary function to get the right value for enabled cassandra.
  22. Usage:
  23. {{ include "common.cassandra.values.enabled" (dict "context" $) }}
  24. */}}
  25. {{- define "common.cassandra.values.enabled" -}}
  26. {{- if .subchart -}}
  27. {{- printf "%v" .context.Values.cassandra.enabled -}}
  28. {{- else -}}
  29. {{- printf "%v" (not .context.Values.enabled) -}}
  30. {{- end -}}
  31. {{- end -}}
  32. {{/*
  33. Auxiliary function to get the right value for the key dbUser
  34. Usage:
  35. {{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }}
  36. Params:
  37. - subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false
  38. */}}
  39. {{- define "common.cassandra.values.key.dbUser" -}}
  40. {{- if .subchart -}}
  41. cassandra.dbUser
  42. {{- else -}}
  43. dbUser
  44. {{- end -}}
  45. {{- end -}}