From 81f99543ec82efd53847dbd8f7fc0540e4bdbae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 20 Jul 2023 22:20:39 +0200 Subject: [PATCH] ci: k8s: Cleanup cluster before deleting it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will help us to in two fronts: * catching possible issues related to kata-deploy cleanup * do more (like, in the future, collect logs) after the tests run Signed-off-by: Fabiano FidĂȘncio --- tests/integration/kubernetes/gha-run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index b38288efc1..cd35fc308c 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -152,6 +152,10 @@ function cleanup() { kubectl delete ${cleanup_spec} kubectl delete -f "${tools_dir}/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml" kubectl delete -f "${tools_dir}/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml" + + if [ "${platform}" = "aks" ]; then + delete_cluster + fi } function delete_cluster() { @@ -190,7 +194,7 @@ function main() { cleanup-sev) cleanup "sev" ;; cleanup-snp) cleanup "snp" ;; cleanup-tdx) cleanup "tdx" ;; - delete-cluster) delete_cluster ;; + delete-cluster) cleanup "aks" ;; *) >&2 echo "Invalid argument"; exit 2 ;; esac }