From c45f646b9d57c14169b61bbff6fe9035878fc484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bombo?= Date: Wed, 5 Jul 2023 14:45:09 -0700 Subject: [PATCH] gha: k8s: Ensure cluster doesn't exist before creating it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cluster cleanup step will sometimes fail to run, meaning the next run would fail in the cluster creation step. This PR addresses that. Example: https://github.com/kata-containers/kata-containers/actions/runs/5349582743/jobs/9867845852 Fixes: #7242 Signed-off-by: Aurélien Bombo --- tests/integration/gha-run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/gha-run.sh b/tests/integration/gha-run.sh index 103ce2cda7..a9a084e494 100755 --- a/tests/integration/gha-run.sh +++ b/tests/integration/gha-run.sh @@ -31,6 +31,9 @@ function login_azure() { } function create_cluster() { + # First, ensure that the cluster didn't fail to get cleaned up from a previous run. + delete_cluster || true + az aks create \ -g "kataCI" \ -n "$(_print_cluster_name)" \ @@ -115,8 +118,7 @@ function delete_cluster() { az aks delete \ -g "kataCI" \ -n "$(_print_cluster_name)" \ - --yes \ - --no-wait + --yes } function main() {