Skip to content

Mark E2E bootstrap tokens as AKS-managed - #280

Merged
hbc (bcho) merged 1 commit into
mainfrom
wenx/fix-e2e-bootstrap-token-label
Aug 19, 2026
Merged

Mark E2E bootstrap tokens as AKS-managed#280
hbc (bcho) merged 1 commit into
mainfrom
wenx/fix-e2e-bootstrap-token-label

Conversation

@wenxuan0923

Copy link
Copy Markdown
Collaborator

Summary

  • mark E2E-created bootstrap token Secrets with kubernetes.azure.com/managedby=aks
  • apply the marker to token, offline, and kubeadm join flows
  • validate the token format before deriving the Secret name and avoid logging token values

Why

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 check
  • bash -n hack/e2e/run.sh hack/e2e/lib/*.sh
  • focused helper validation for valid and invalid token formats

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 corresponding kube-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.

Comment thread hack/e2e/lib/common.sh
@bcho
hbc (bcho) merged commit f3a8f80 into main Aug 19, 2026
13 checks passed
@bcho
hbc (bcho) deleted the wenx/fix-e2e-bootstrap-token-label branch August 19, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants