Allow post-install hook to retry
The sonarqube helm chart has a post-install hook to change the admin password. The delete policy for the hook is set to only delete on success. https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/sonarqube/-/blob/9.6.3-bb.16/chart/templates/change-admin-password-hook.yml#L17
Our openshift clusters often have the post-install hook fail on its first attempt, but when attempting the second try, it errors out that the job already exists:
Helm install failed: failed post-install: warning: Hook post-install
sonarqube/templates/change-admin-password-hook.yml failed: jobs.batch
"sonarqube-sonarqube-change-admin-password-hook" already exists
I think adding the before-hook-creation
value to the helm.sh/hook-delete-policy
annotation in the helm chart linked above would solve the problem for us.
Helm hooks docs: https://helm.sh/docs/topics/charts_hooks/#hook-deletion-policies