Interview Prep/Helm/Hooks, Tests, GitOps & Secrets

`Error: UPGRADE FAILED: pre-upgrade hooks failed: warning: Hook pre-upgrade shop/templates/migrate-job.yaml failed: jobs.batch "shop-migrate" already exists`

BeginnerTroubleshootingHooks, Tests, GitOps & Secrets
Answer

Likely causes → A previous hook Job was not deleted (no before-hook-creation policy, or a policy with only hook-succeeded and the last run failed).

Diagnose → kubectl get job shop-migrate -n shop.

Fix → kubectl delete job shop-migrate -n shop and rerun; add "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded.

Prevent → Always include before-hook-creation on hook Jobs and test Pods.

All Helm questions Roadmap: Helm

More on Hooks, Tests, GitOps & Secrets