[E2E] add MSI-based ARM Machine registration E2E - #291
[E2E] add MSI-based ARM Machine registration E2E#291Wenxuan W (wenxuan0923) wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the AKS Flex Node E2E suite with a dedicated MSI-based scenario that validates real ARM Machine registration (machineClient.mode: arm) before running the existing controller-backed lifecycle coverage, and preserves ARM responses + bootstrap logs as artifacts for debugging.
Changes:
- Add a new
arm-registrationE2E command and run it as part of the defaultallflow. - Introduce an ARM Machine registration scenario that verifies Machine absence, performs bootstrap-driven registration, validates the ARM resource + create-path log, then resets/reuses the MSI host.
- Add configuration/documentation plumbing for
E2E_ARM_MACHINE_API_VERSIONand update workflow/docs to reflect the new coverage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hack/e2e/run.sh | Adds arm-registration command and runs ARM registration as part of all. |
| hack/e2e/README.md | Documents the new ARM registration phase and environment variable. |
| hack/e2e/lib/node-join-msi.sh | Refactors MSI join to support both in-cluster and ARM Machine backends. |
| hack/e2e/lib/common.sh | Adds default/config logging for E2E_ARM_MACHINE_API_VERSION. |
| hack/e2e/lib/arm-machine-registration.sh | New ARM registration E2E scenario implementation (MSI-host reuse + validation). |
| .github/workflows/e2e-tests.yml | Updates workflow description to include ARM Machine registration coverage. |
| .env.example | Adds example E2E_ARM_MACHINE_API_VERSION setting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
hack/e2e/run.sh:10
- The usage text for the
allcommand no longer matches whatcmd_allactually runs (it omits validate-absent, lifecycle, agent-upgrade, upgrade-drift, and log collection). This can mislead anyone using--help.
# all Run the full E2E flow (default): build, infra, CNI, controller,
# ARM registration, join, validate, unjoin, rejoin, cleanup
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
hack/e2e/lib/arm-machine-registration.sh:229
- The ARM authorization probe passes the Authorization header via
curl -H ..., which places the access token in the process arguments on the VM while the request is running. This can leak credentials viaps/process inspection and is inconsistent with the safercurl --config -pattern used elsewhere in this script.
status="$(curl -sS -o "${response_file}" -w '%{http_code}' \
-H "Authorization: Bearer ${token}" \
"${ARM_MACHINE_URL}" || true)"
Code reviewFound 1 issue:
AKSFlexNode/hack/e2e/lib/arm-machine-registration.sh Lines 217 to 230 in 52eac0c |
Feed the ARM authorization header to curl through stdin so local process inspection cannot expose the bearer token.
Fixed. The auth header is now passed to curl through stdin with |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
hack/e2e/run.sh:14
- The
arm-registrationcommand help text doesn’t mention that it requiresinfrato have been run already (it relies on the provisioned cluster + MSI VM state). This makes./hack/e2e/run.sh --helpinconsistent with other commands likejointhat explicitly call out the prerequisite.
# arm-registration Validate MSI-based registration through the ARM Machine API
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Why
The existing E2E suite exercises controller-backed Machine fixtures, but it does not prove that a real node configured with
agent.machineClient.mode: armcan register a missing AKS Machine through ARM.This PR adds that live coverage for the registration workflow discussed in #285. It is intentionally separate from the ARM client retry change in #290.
What this tests
The new
arm-registrationscenario runs before the existing controller-backed lifecycle suite and reuses the managed-identity VM:machineClient.mode: armandrequireMachineRegistration: true, without pre-creating a controller Machine fixture.EnsureMachinetakes the create path and ARM returns a Machine with the expected name, Kubernetes version, non-empty ETag, andSucceededprovisioning state.deleteMachinesaction, and prove the resource is absent.The same cleanup path runs before a retry and after a failed attempt, so
arm-registrationis safe to rerun against the same E2E infrastructure. ARM responses and bootstrap logs are retained as workflow artifacts.Existing Arc E2E hardening
Full-suite validation exposed a pre-existing 403 in the later Arc
listBootstrapDatastep; the same failure reproduced onmainand was not caused by the new Machine registration scenario.This PR keeps the successful full-suite fix that:
arc_role_assigned=truestate;Validation
go test ./...go test ./pkg/bootstrapdatagit diff --checkmake checkreached lint locally, but the installedgolangci-lintwas built with Go 1.25.4 and cannot lint the repository's Go 1.26.5 target. The canonical GitHub Lint check passed.