Skip to content

fix: propagate SERVICE_ACCOUNT_ISSUER to workload cluster template#6306

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
andyzhangx:fix-wi-issuer-propagation-main
May 13, 2026
Merged

fix: propagate SERVICE_ACCOUNT_ISSUER to workload cluster template#6306
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
andyzhangx:fix-wi-issuer-propagation-main

Conversation

@andyzhangx
Copy link
Copy Markdown
Member

@andyzhangx andyzhangx commented May 13, 2026

What this PR does

kind-with-registry.sh creates an OIDC storage account and exports SERVICE_ACCOUNT_ISSUER, but this value is lost when create-workload-cluster runs envsubst in a separate Make recipe (each recipe line runs in its own shell).

The workload cluster template (#6288) has:

service-account-issuer: ${SERVICE_ACCOUNT_ISSUER:-https://kubernetes.default.svc.cluster.local}

Without propagation, the fallback https://kubernetes.default.svc.cluster.local is used — which is not publicly accessible, causing AAD Workload Identity token validation to fail with AADSTS501661.

Changes

  1. scripts/kind-with-registry.sh: Persist SERVICE_ACCOUNT_ISSUER to ${REPO_ROOT}/.service-account-issuer.env after OIDC setup
  2. Makefile: Source .service-account-issuer.env in create-workload-cluster target before running envsubst
  3. .gitignore: Add .service-account-issuer.env (contains environment-specific values)

Related

Release note:

none

kind-with-registry.sh creates an OIDC storage account and sets
SERVICE_ACCOUNT_ISSUER, but this value was lost when
create-workload-cluster runs envsubst in a separate shell context.

The workload cluster template has:
  service-account-issuer: ${SERVICE_ACCOUNT_ISSUER:-https://kubernetes.default.svc.cluster.local}

Without the propagation, the fallback value is used, which is
unreachable by AAD for OIDC discovery, breaking Workload Identity
on CAPZ workload clusters.

Fix: persist SERVICE_ACCOUNT_ISSUER to a .env file in
kind-with-registry.sh and source it in the create-workload-cluster
Makefile target before running envsubst.
@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label May 13, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 13, 2026
@andyzhangx
Copy link
Copy Markdown
Member Author

/assign @mboersma

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.84%. Comparing base (55942b8) to head (024436b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6306   +/-   ##
=======================================
  Coverage   43.84%   43.84%           
=======================================
  Files         289      289           
  Lines       25346    25346           
=======================================
  Hits        11114    11114           
  Misses      13458    13458           
  Partials      774      774           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 909e491eabc3f357b8ca857ead6da1547859086e

@mboersma
Copy link
Copy Markdown
Contributor

/cherry-pick release-1.24

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: once the present PR merges, I will cherry-pick it on top of release-1.24 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-1.24

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mboersma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2026
@mboersma
Copy link
Copy Markdown
Contributor

/cherry-pick release-1.23

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: once the present PR merges, I will cherry-pick it on top of release-1.23 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-1.23

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot merged commit 0e1a141 into kubernetes-sigs:main May 13, 2026
31 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone May 13, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in CAPZ Planning May 13, 2026
@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: new pull request created: #6307

Details

In response to this:

/cherry-pick release-1.24

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: new pull request created: #6308

Details

In response to this:

/cherry-pick release-1.23

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants