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'