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