_mysql.tpl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.mysql.values.auth.existingSecret" (dict "context" $) }}
  10. Params:
  11. - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
  12. */}}
  13. {{- define "common.mysql.values.auth.existingSecret" -}}
  14. {{- if .subchart -}}
  15. {{- .context.Values.mysql.auth.existingSecret | quote -}}
  16. {{- else -}}
  17. {{- .context.Values.auth.existingSecret | quote -}}
  18. {{- end -}}
  19. {{- end -}}
  20. {{/*
  21. Auxiliary function to get the right value for enabled mysql.
  22. Usage:
  23. {{ include "common.mysql.values.enabled" (dict "context" $) }}
  24. */}}
  25. {{- define "common.mysql.values.enabled" -}}
  26. {{- if .subchart -}}
  27. {{- printf "%v" .context.Values.mysql.enabled -}}
  28. {{- else -}}
  29. {{- printf "%v" (not .context.Values.enabled) -}}
  30. {{- end -}}
  31. {{- end -}}
  32. {{/*
  33. Auxiliary function to get the right value for architecture
  34. Usage:
  35. {{ include "common.mysql.values.architecture" (dict "subchart" "true" "context" $) }}
  36. Params:
  37. - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
  38. */}}
  39. {{- define "common.mysql.values.architecture" -}}
  40. {{- if .subchart -}}
  41. {{- .context.Values.mysql.architecture -}}
  42. {{- else -}}
  43. {{- .context.Values.architecture -}}
  44. {{- end -}}
  45. {{- end -}}
  46. {{/*
  47. Auxiliary function to get the right value for the key auth
  48. Usage:
  49. {{ include "common.mysql.values.key.auth" (dict "subchart" "true" "context" $) }}
  50. Params:
  51. - subchart - Boolean - Optional. Whether MySQL is used as subchart or not. Default: false
  52. */}}
  53. {{- define "common.mysql.values.key.auth" -}}
  54. {{- if .subchart -}}
  55. mysql.auth
  56. {{- else -}}
  57. auth
  58. {{- end -}}
  59. {{- end -}}