From 3720ffb9a557e31681f1bf59e74ddfae9b1fc14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bombo?= Date: Wed, 15 Jan 2025 16:24:03 -0600 Subject: [PATCH] tests: Introduce AZ_REGION and AZ_NODEPOOL_TAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can be useful to set these variables during local testing: * AZ_REGION: If the default region is out of quota for the used VM SKUs. * AZ_NODEPOOL_TAGS: If your Azure subscription requires to set Azure security policies through nodepool tags. Signed-off-by: Aurélien Bombo --- tests/gha-run-k8s-common.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/gha-run-k8s-common.sh b/tests/gha-run-k8s-common.sh index 9dc2a93550..0e827b22b6 100644 --- a/tests/gha-run-k8s-common.sh +++ b/tests/gha-run-k8s-common.sh @@ -9,6 +9,8 @@ source "${tests_dir}/common.bash" kubernetes_dir="${tests_dir}/integration/kubernetes" helm_chart_dir="${repo_root_dir}/tools/packaging/kata-deploy/helm-chart/kata-deploy" +AZ_REGION="${AZ_REGION:-eastus}" +AZ_NODEPOOL_TAGS="${AZ_NODEPOOL_TAGS:-}" GENPOLICY_PULL_METHOD="${GENPOLICY_PULL_METHOD:-oci-distribution}" GH_PR_NUMBER="${GH_PR_NUMBER:-}" HELM_DEFAULT_INSTALLATION="${HELM_DEFAULT_INSTALLATION:-false}" @@ -106,7 +108,7 @@ function create_cluster() { "GENPOLICY_PULL_METHOD=${GENPOLICY_PULL_METHOD:0:1}") az group create \ - -l eastus \ + -l "${AZ_REGION}" \ -n "${rg}" # Required by e.g. AKS App Routing for KBS installation. @@ -123,7 +125,8 @@ function create_cluster() { -s "$(_print_instance_type)" \ --node-count 1 \ --generate-ssh-keys \ - --tags "${tags[@]}" + --tags "${tags[@]}" \ + $([ -n "${AZ_NODEPOOL_TAGS}" ] && echo "--nodepool-tags "${AZ_NODEPOOL_TAGS}"") } function install_bats() {