mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-14 14:14:15 +00:00
gha: k8s: Ensure cluster doesn't exist before creating it
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 <abombo@microsoft.com>
This commit is contained in:
parent
a25d5b9807
commit
c45f646b9d
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user