Mark E2E bootstrap tokens as AKS-managed - #280
Merged
Merged
Conversation
Wenxuan W (wenxuan0923)
temporarily deployed
to
e2e-testing
August 19, 2026 00:30 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the E2E join harness to label E2E-created Kubernetes bootstrap token Secrets as AKS-managed (kubernetes.azure.com/managedby=aks) so the managed FlexNode CSR approver will accept bootstrap-token-based CSRs and E2E joins won’t stall.
Changes:
- Add a shared helper (
mark_e2e_bootstrap_token_aks_managed) that validates bootstrap token format and labels the correspondingkube-system/bootstrap-token-<id>Secret. - Invoke that helper in the token-based, offline-artifacts, and kubeadm join flows immediately after token creation/config generation.
- Avoid logging full token values by deriving the Secret name from the token ID only.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hack/e2e/lib/node-join-token.sh | After generating a bootstrap-token config, labels the backing Secret as AKS-managed under the cluster lock. |
| hack/e2e/lib/node-join-offline.sh | Same labeling step added to the offline-artifacts bootstrap-token join flow. |
| hack/e2e/lib/node-join-kubeadm.sh | Labels the kubeadm-created bootstrap token Secret as AKS-managed (already under the cluster lock). |
| hack/e2e/lib/common.sh | Introduces mark_e2e_bootstrap_token_aks_managed helper (token format validation + kubectl label). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hbc (bcho)
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kubernetes.azure.com/managedby=aksWhy
The managed AKS FlexNode CSR approver now runs alongside the E2E controller. It rejects bootstrap-token daemon CSRs unless the backing Secret carries the AKS managed-by label. The rejection wins before the E2E controller can approve, leaving token-backed daemons without credentials and causing unjoin to time out.
Example failure: https://github.com/Azure/AKSFlexNode/actions/runs/32195931630/job/95899825113
The required contract is implemented by aks-rp PR 16150772. This change is intentionally limited to the E2E harness; public token generation and production behavior are unchanged.
Validation
make checkbash -n hack/e2e/run.sh hack/e2e/lib/*.sh