fix: always delete instance jobs and detach PVCs before the pod in cn… · cloudnative-pg/cloudnative-pg@50256d1 · GitHub
Skip to content

Commit 50256d1

Browse files
armruNiccoloFei
authored andcommitted
fix: always delete instance jobs and detach PVCs before the pod in cnpg destroy
The previous commit's restructure skipped job cleanup when --keep-pvc is used, even though that cleanup was introduced by #5298 to remove jobs left over from the instance. The keep-pvc path also still deleted the pod before detaching the PVCs, leaving the same reattach window the previous commit closes for the delete path. Unify both paths so PVCs are handled first, then the pod, then the jobs, regardless of --keep-pvc, and cover the command with unit tests. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
1 parent a17e8c2 commit 50256d1

3 files changed

Lines changed: 452 additions & 44 deletions

File tree

‎internal/cmd/plugin/destroy/destroy.go‎

Lines changed: 62 additions & 44 deletions

0 commit comments

Comments
 (0)