_helpers.tpl 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{/*
  2. Retrieve secret name for secure credentials
  3. */}}
  4. {{- define "secretName" -}}
  5. {{- print "credentials" -}}
  6. {{- end -}}
  7. {{/*
  8. Retrieve true/false if certificate is configured
  9. */}}
  10. {{- define "certAvailable" -}}
  11. {{- if .Values.certificate -}}
  12. {{- $values := (. | mustDeepCopy) -}}
  13. {{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
  14. {{- template "common.resources.cert_present" $values -}}
  15. {{- else -}}
  16. {{- false -}}
  17. {{- end -}}
  18. {{- end -}}
  19. {{/*
  20. Retrieve public key of certificate
  21. */}}
  22. {{- define "cert.publicKey" -}}
  23. {{- $values := (. | mustDeepCopy) -}}
  24. {{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate "publicKey" true) -}}
  25. {{ include "common.resources.cert" $values }}
  26. {{- end -}}
  27. {{/*
  28. Retrieve private key of certificate
  29. */}}
  30. {{- define "cert.privateKey" -}}
  31. {{- $values := (. | mustDeepCopy) -}}
  32. {{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
  33. {{ include "common.resources.cert" $values }}
  34. {{- end -}}