From 4703434b120a010060732928093a3204ca9e5455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bombo?= Date: Tue, 25 Jul 2023 14:48:34 -0700 Subject: [PATCH] tests: k8s: Allow using custom resource group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This simply allows setting a custom resource group when debugging locally, so as to prevent name collisions and not pollute the namespace. Signed-off-by: Aurélien Bombo --- tests/integration/kubernetes/gha-run.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index 4d8f9a6f2c..ee4d26be34 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -12,6 +12,8 @@ kubernetes_dir="$(dirname "$(readlink -f "$0")")" source "${kubernetes_dir}/../../common.bash" tools_dir="${repo_root_dir}/tools" +AZ_RG="${AZ_RG:-kataCI}" + function _print_cluster_name() { short_sha="$(git rev-parse --short=12 HEAD)" echo "${GH_PR_NUMBER}-${short_sha}-${KATA_HYPERVISOR}-${KATA_HOST_OS}-amd64" @@ -36,7 +38,7 @@ function create_cluster() { delete_cluster || true az aks create \ - -g "kataCI" \ + -g "${AZ_RG}" \ -n "$(_print_cluster_name)" \ -s "Standard_D4s_v5" \ --node-count 1 \ @@ -55,7 +57,7 @@ function install_kubectl() { function get_cluster_credentials() { az aks get-credentials \ - -g "kataCI" \ + -g "${AZ_RG}" \ -n "$(_print_cluster_name)" } @@ -156,7 +158,7 @@ function cleanup() { function delete_cluster() { az aks delete \ - -g "kataCI" \ + -g "${AZ_RG}" \ -n "$(_print_cluster_name)" \ --yes }