From 6d367d8d938331f6c8c4ac4c21ff55755894a395 Mon Sep 17 00:00:00 2001 From: Lukianov Artyom Date: Wed, 8 Nov 2017 15:38:32 +0200 Subject: [PATCH] Improve removing traces from old deployments Signed-off-by: Lukianov Artyom --- automation/test.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/automation/test.sh b/automation/test.sh index 7288c923070d..e978e94752fb 100644 --- a/automation/test.sh +++ b/automation/test.sh @@ -96,9 +96,18 @@ echo "" echo "" # Delete traces from old deployments -kubectl delete deployments --all -kubectl delete ds --all -kubectl delete pods --all +namespaces=(default kube-system) +for i in ${namespaces[@]}; do + kubectl -n ${i} delete deployment -l 'app' + kubectl -n ${i} delete services -l '!k8s-app' + kubectl -n ${i} delete pv --all + kubectl -n ${i} delete pvc --all + kubectl -n ${i} delete ds -l 'daemon' + kubectl -n ${i} delete crd --all + kubectl -n ${i} delete serviceaccounts -l 'name in (kubevirt, kubevirt-admin)' + kubectl -n ${i} delete clusterrolebinding -l 'name=kubevirt' + kubectl -n ${i} delete pods -l 'app' +done # Deploy kubevirt cluster/sync.sh