Validate AKS Machine goal responses - #276
Merged
Merged
Conversation
Wenxuan W (wenxuan0923)
temporarily deployed
to
e2e-testing
August 14, 2026 20:39 — with
GitHub Actions
Inactive
Wenxuan W (wenxuan0923)
marked this pull request as ready for review
August 14, 2026 20:57
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the contract around AKS Machine “goal” responses by requiring that remote Machine objects include a valid desired Kubernetes goal and a non-empty ETag-backed SettingsVersion, and by removing previous client-side fallbacks/synthesis.
Changes:
- Add
(*aksmachine.Machine).Validate()and use it to reject incomplete/invalid Machine goal payloads. - Remove synthesized
SettingsVersion(and other fallback goal population) from local config and ARM/cluster-endpoint parsing paths. - Extend unit tests across daemon reconciliation, ARM client parsing, in-cluster endpoint parsing, and ensure-machine bootstrap behavior to cover invalid/missing goal fields.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/daemon/repave_reconciler.go | Validate Machine snapshots before using them in daemon reconciliation. |
| pkg/daemon/repave_reconciler_test.go | Add coverage ensuring reconciliation rejects invalid Machine goals and does not apply them. |
| pkg/aksmachine/types.go | Stop seeding SettingsVersion from config; introduce Machine.Validate() enforcing goal + ETag. |
| pkg/aksmachine/types_test.go | Update config-goal expectations and add tests for Machine.Validate(). |
| pkg/aksmachine/ensure.go | Require validated Machine responses; adopt remote ETag as SettingsVersion without synthesizing. |
| pkg/aksmachine/ensure_test.go | Update bootstrap/ensure-machine tests for new SettingsVersion semantics and invalid responses. |
| pkg/aksmachine/client_incluster.go | Validate adopted/decoded cluster-endpoint Machine responses and stop filling from local desired state. |
| pkg/aksmachine/client_incluster_test.go | Add test coverage for rejecting endpoint responses missing ETag. |
| pkg/aksmachine/client_armapi.go | Validate ARM Create/Get responses and stop synthesizing versions from Kubernetes version/current version. |
| pkg/aksmachine/client_armapi_test.go | Adjust tests to confirm no use of current orchestrator fallback and no SettingsVersion synthesis. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hbc (bcho)
reviewed
Aug 14, 2026
Wenxuan W (wenxuan0923)
temporarily deployed
to
e2e-testing
August 14, 2026 22:39 — with
GitHub Actions
Inactive
hbc (bcho)
approved these changes
Aug 14, 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
Validation
make checkContext
This is the second independent replacement for draft PR #256 and can merge independently of the server-owned-label PR.