Skip to content

feat(aks-live-patching): add shared live-patching status package - #10047

Open
C.YAO (YaoC) wants to merge 1 commit into
mainfrom
chyao/live-patching-status-pkg
Open

C.YAO (YaoC) wants to merge 1 commit into
mainfrom
chyao/live-patching-status-pkg

Conversation

@YaoC

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds aks-live-patching/pkg/status, a shared Go definition of the generic live-patching node contract. The live-patching controller (LPC), the AKS RP and the AKS E2E tests each keep their own copy of it today.

  • Annotation names: kubernetes.azure.com/live-patching-config-goal-hash (stamped by LPC) and kubernetes.azure.com/live-patching-status (written by the node-side live-patching loop).
  • Component names: securityPatch, npdConfig, npdBinary, localDNS, aksNodeController, matching the names the RP renders into the live-patching config.
  • Status document: Status / ComponentStatus, the same JSON {"currentHash": ..., "components": {"<name>": {"code": ..., "current": ..., "message": ...}}} that ubuntu-snapshot-update.sh and mariner-package-update.sh write. Keeping it next to those scripts lets a format change land in one PR.
  • Helpers:
    • Parse: an empty annotation is a node that hasn't reported yet, not an error.
    • IsProcessed(goalHash): the node has processed that config.
    • IsConverged(goalHash): every component succeeded (LPC's rule).
    • ComponentSucceeded(goalHash, component): one component succeeded. The RP uses this to wait only on securityPatch, so unrelated component failures don't block a security patch operation.

The package uses only the standard library, so go.mod is unchanged. It includes table-driven unit tests. A comment in .github/workflows/go-test.yml said aks-live-patching has no unit tests; I reworded it. The CI logic is unchanged.

Consumers: the AKS RP will use this to check live-patching-status in IsLivePatchingComplete (keeping the legacy current-timestamp check for older VHDs), and LPC can replace its internal copy.

No VHD or provisioning behavior changes.

Which issue(s) this PR fixes:

N/A

🤖 Generated with Claude Code

@YaoC
C.YAO (YaoC) requested review from a team as code owners November 10, 2026 22:51
Copilot AI balanced review requested due to automatic review settings November 10, 2026 22:51
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   1m 5s ⏱️
789 tests 789 ✅ 0 💤 0 ❌
815 runs  815 ✅ 0 💤 0 ❌

Results for commit e4e028d.

♻️ This comment has been updated with latest results.

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.

🟢 Approval recommended

No active review issues are reported for the change introducing a shared live-patching status contract.

No open issues 🎉

What changed in this PR

Adds a shared Go package for the live-patching status contract, enabling the controller, AKS resource provider, and end-to-end tests to replace duplicated definitions. No VHD or provisioning behavior changes.

Changes:

  • Defines annotation keys, component names, status types, and parsing and completion-check helpers.
  • Adds unit tests for parsing, hash matching, convergence, and component-specific success.
  • Updates a coverage workflow comment without changing CI logic.
File Description
aks-live-patching/​pkg/​status/​status.go Defines the shared status contract and helper methods.
aks-live-patching/​pkg/​status/​status_test.go Tests parsing and status-check behavior.
.github/​workflows/​go-test.yml Removes the outdated comment stating that live-patching has no unit tests.

Review effort: Balanced

Add aks-live-patching/pkg/status with the generic live-patching node
contract: the goal-hash and live-patching-status annotation names, the
component names, the Succeeded result code, the Status document the node
loop writes, and helpers to parse and evaluate it (IsProcessed,
IsConverged, ComponentSucceeded).

The live-patching-controller, the AKS RP and the E2E tests each define
their own copy of this contract today; this gives them one definition next
to the VHD scripts that write the status.

Co-Authored-By: Claude <noreply@anthropic.com>
@YaoC
C.YAO (YaoC) force-pushed the chyao/live-patching-status-pkg branch from 81e0c78 to e4e028d Compare November 10, 2026 22:58
Copilot AI balanced review requested due to automatic review settings November 10, 2026 22:58
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 71% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 73% ➖
Summary 39% (1983 / 7220) ❌

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.

🟢 Approval recommended

No active review issues remain for the shared live-patching status contract changes.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 30% ❌
Summary 30% (4912 / 16591) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 73% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 92% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
github.com/Azure/agentbaker/apiserver 24% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 35% ❌
github.com/Azure/agentbaker/pkg/agent 79% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 77% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
github.com/Azure/agentbaker/aks-live-patching/pkg/status 100% ✔
Summary 84% (6117 / 8063) ✔

This branch has not been deployed

No deployments
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.

2 participants