From f395ae08a30b112f56297500d97453c08535229c Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Sun, 1 Mar 2026 20:58:37 +0000 Subject: [PATCH] fix: clean stale CSI smoke resources before apply --- ansible/roles/csi/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ansible/roles/csi/tasks/main.yml b/ansible/roles/csi/tasks/main.yml index bed56b2..c5d888a 100644 --- a/ansible/roles/csi/tasks/main.yml +++ b/ansible/roles/csi/tasks/main.yml @@ -145,6 +145,14 @@ msg: "CSI node daemonset rollout failed: {{ csi_node_rollout.stdout | default('') }} {{ csi_node_rollout.stderr | default('') }}" when: csi_node_rollout.rc != 0 +- name: Cleanup stale CSI smoke test resources before apply + shell: | + kubectl -n kube-system delete job csi-smoke-job pvc csi-smoke-pvc --ignore-not-found --wait=true + kubectl delete storageclass {{ csi_smoke_test_storage_class }} --ignore-not-found + failed_when: false + changed_when: false + when: csi_smoke_test_enabled | bool + - name: Apply CSI smoke test resources shell: | kubectl apply -f - <<'EOF'