fix: delete PVCs before pod in cnpg destroy to prevent race condition · cloudnative-pg/cloudnative-pg@9a58c8b · GitHub
Skip to content

Commit 9a58c8b

Browse files
daanvinkenNiccoloFei
authored andcommitted
fix: delete PVCs before pod in cnpg destroy to prevent race condition
The destroy command deleted the pod first, then the PVCs. Between those calls, the operator's reconcile loop could see dangling PVCs and recreate the pod, requiring a second invocation of destroy to clean up. Delete PVCs before the pod to match the deletion order used by the operator's internal ensureInstanceIsDeleted in cluster_scale.go. Signed-off-by: Daan Vinken <daanvinken@tythus.com>
1 parent 843b4df commit 9a58c8b

1 file changed

Lines changed: 32 additions & 25 deletions

File tree

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

Lines changed: 32 additions & 25 deletions

0 commit comments

Comments
 (0)