_errors.tpl 1.6 KB

1234567891011121314151617181920212223
  1. {{/* vim: set filetype=mustache: */}}
  2. {{/*
  3. Through error when upgrading using empty passwords values that must not be empty.
  4. Usage:
  5. {{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}}
  6. {{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}}
  7. {{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }}
  8. Required password params:
  9. - validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error.
  10. - context - Context - Required. Parent context.
  11. */}}
  12. {{- define "common.errors.upgrade.passwords.empty" -}}
  13. {{- $validationErrors := join "" .validationErrors -}}
  14. {{- if and $validationErrors .context.Release.IsUpgrade -}}
  15. {{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}}
  16. {{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}}
  17. {{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}}
  18. {{- $errorString = print $errorString "\n%s" -}}
  19. {{- printf $errorString $validationErrors | fail -}}
  20. {{- end -}}
  21. {{- end -}}