Merge pull request #9007 from wainersm/aks_delete_rg

gha: delete azure RG only if it exists
This commit is contained in:
Xuewei Niu 2024-02-04 16:34:17 +08:00 committed by GitHub
commit fa01a86334
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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() {