Skip to content

Validate AKS Machine goal responses - #276

Merged
Wenxuan W (wenxuan0923) merged 3 commits into
mainfrom
wenx/strict-machine-contract
Aug 14, 2026
Merged

Validate AKS Machine goal responses#276
Wenxuan W (wenxuan0923) merged 3 commits into
mainfrom
wenx/strict-machine-contract

Conversation

@wenxuan0923

Copy link
Copy Markdown
Collaborator

Summary

  • Require AKS Machine responses to include a valid desired Kubernetes goal and ETag-backed settings version.
  • Stop synthesizing settings versions or filling remote responses from local desired state.
  • Validate responses from ARM, the in-cluster endpoint, bootstrap registration, and daemon reconciliation before use.
  • Preserve the current local-authoritative bootstrap behavior; adopting complete remote goals is intentionally deferred to a follow-up PR.

Validation

  • make check

Context

This is the second independent replacement for draft PR #256 and can merge independently of the server-owned-label PR.

@wenxuan0923
Wenxuan W (wenxuan0923) marked this pull request as ready for review August 14, 2026 20:57
Copilot AI lite review requested due to automatic review settings August 14, 2026 20:57

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

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.

Comment thread pkg/aksmachine/ensure_test.go
Comment thread pkg/aksmachine/types_test.go
Comment thread pkg/aksmachine/client_armapi.go Outdated
Comment thread pkg/aksmachine/ensure.go Outdated

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@wenxuan0923
Wenxuan W (wenxuan0923) merged commit 072fe11 into main Aug 14, 2026
14 checks passed
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