Skip to content

Commit

Permalink
Merge pull request #9007 from wainersm/aks_delete_rg
Browse files Browse the repository at this point in the history
gha: delete azure RG only if it exists
  • Loading branch information
justxuewei committed Feb 4, 2024
2 parents e0bb632 + a04b215 commit fa01a86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/gha-run-k8s-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ function get_cluster_credentials() {

function delete_cluster() {
test_type="${1:-k8s}"
local rg
rg="$(_print_rg_name ${test_type})"

az group delete \
-g "$(_print_rg_name ${test_type})" \
--yes
if [ "$(az group exists -g "${rg}")" == "true" ]; then
az group delete -g "${rg}" --yes
fi
}

function delete_cluster_kcli() {
Expand Down

0 comments on commit fa01a86

Please sign in to comment.