Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ azure_identity_id
azure_wi_back_compat
openid-configuration.json
aks-mgmt.config
.service-account-issuer.env
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,13 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
.PHONY: create-workload-cluster
create-workload-cluster: $(ENVSUBST) $(KUBECTL) ## Create a workload cluster.
# Create workload Cluster.
@if [ -z "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}" ]; then \
# Source SERVICE_ACCOUNT_ISSUER from kind-with-registry.sh if available,
# so the workload cluster template gets the correct OIDC issuer URL.
@if [ -f "$(ROOT_DIR)/.service-account-issuer.env" ]; then \
. "$(ROOT_DIR)/.service-account-issuer.env"; \
export SERVICE_ACCOUNT_ISSUER; \
fi; \
if [ -z "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}" ]; then \
export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$(shell cat $(AZURE_IDENTITY_ID_FILEPATH)); \
fi; \
if [ -f "$(TEMPLATES_DIR)/$(CLUSTER_TEMPLATE)" ]; then \
Expand Down
7 changes: 7 additions & 0 deletions scripts/kind-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ EOF
--audiences "api://AzureADTokenExchange" \
--subject "system:serviceaccount:capz-system:azureserviceoperator-default" --output none --only-show-errors
fi

# Persist SERVICE_ACCOUNT_ISSUER so that downstream make targets
# (e.g., create-workload-cluster) running in separate shell contexts
# can pick it up via the .service-account-issuer.env file.
if [ -n "${SERVICE_ACCOUNT_ISSUER}" ]; then
echo "SERVICE_ACCOUNT_ISSUER=${SERVICE_ACCOUNT_ISSUER}" > "${REPO_ROOT}/.service-account-issuer.env"
fi
}

function upload_to_blob() {
Expand Down
Loading