From 22806480bb2a095af4a1a75faa3d32cbc2614de4 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 24 Oct 2025 00:37:28 -0500 Subject: [PATCH] Fix bash syntax for make cleanup-workload-identity --- Makefile | 2 +- hack/util.sh | 4 ++++ scripts/ci-conformance.sh | 2 ++ scripts/ci-e2e.sh | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4277eeb0655..3e3ab10532e 100644 --- a/Makefile +++ b/Makefile @@ -778,7 +778,7 @@ create-bootstrap: $(KUBECTL) ## Create bootstrap cluster (AKS or KIND) for CAPZ .PHONY: cleanup-workload-identity cleanup-workload-identity: ## Cleanup CI workload-identity infra @if ! [ "$(AZWI_SKIP_CLEANUP)" == "true" ]; then \ - ./scripts/cleanup-workload-identity.sh \ + ./scripts/cleanup-workload-identity.sh; \ fi ## -------------------------------------- diff --git a/hack/util.sh b/hack/util.sh index 220b98611ce..62a77fedabd 100755 --- a/hack/util.sh +++ b/hack/util.sh @@ -114,3 +114,7 @@ capz::util::ensure_azure_envs() { : "${AZURE_SUBSCRIPTION_ID:?Environment variable empty or not defined.}" : "${AZURE_TENANT_ID:?Environment variable empty or not defined.}" } + +capz::util::random_suffix() { + od -An -N8 -tx8 /dev/urandom | tr -d ' ' | head -c 16 +} diff --git a/scripts/ci-conformance.sh b/scripts/ci-conformance.sh index 934f9fa501c..cf924802d38 100755 --- a/scripts/ci-conformance.sh +++ b/scripts/ci-conformance.sh @@ -82,6 +82,8 @@ export AZURE_LOCATION_EDGEZONE="${AZURE_LOCATION_EDGEZONE:-$(capz::util::get_ran export AZURE_CONTROL_PLANE_MACHINE_TYPE="${AZURE_CONTROL_PLANE_MACHINE_TYPE:-"Standard_B2s"}" export AZURE_NODE_MACHINE_TYPE="${AZURE_NODE_MACHINE_TYPE:-"Standard_B2s"}" export WINDOWS="${WINDOWS:-false}" +AZWI_RESOURCE_GROUP="${AZWI_RESOURCE_GROUP:-capz-wi-$(capz::util::random_suffix)}" +export AZWI_RESOURCE_GROUP # Generate SSH key. capz::util::generate_ssh_key diff --git a/scripts/ci-e2e.sh b/scripts/ci-e2e.sh index ba07d5c6fe1..ccd35cc1763 100755 --- a/scripts/ci-e2e.sh +++ b/scripts/ci-e2e.sh @@ -70,6 +70,8 @@ export AZURE_CONTROL_PLANE_MACHINE_TYPE="${AZURE_CONTROL_PLANE_MACHINE_TYPE:-"St export AZURE_NODE_MACHINE_TYPE="${AZURE_NODE_MACHINE_TYPE:-"Standard_B2s"}" CALICO_VERSION=$(make get-calico-version) export CALICO_VERSION +AZWI_RESOURCE_GROUP="${AZWI_RESOURCE_GROUP:-capz-wi-$(capz::util::random_suffix)}" +export AZWI_RESOURCE_GROUP capz::util::generate_ssh_key