You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
π‘ Changes recommended
Build-breaking API signature changes and a status-patch rejection bug need fixing before merge.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR introduces a split/pinning model for NodeClass Kubernetes version and node image version selection, including new API fields, status tracking, controller logic, and validation to support explicit version pinning and rollbacks.
Changes:
Add spec.versions to AKSNodeClass and status.versions to track control-plane version, latest image version, and recently used versions.
Extend the NodeClass status reconcilers to validate requested Kubernetes versions, drive image resolution for requested versions, and support pinning/rollback behavior.
Wire a new AKS Managed Clusters client into the operator/providers and add integration/unit tests for pinning flows.
File summaries
File
Description
test/suites/integration/nodeimagepinning_test.go
New integration coverage for Kubernetes/node image pinning behavior
NewAZClientFromAPI now requires a managedClustersClient, but at least one call site still uses the old argument list (e.g. pkg/test/environment.go), which will break compilation. Ensure all NewAZClientFromAPI callers and relevant fakes are updated to pass an AKSManagedClustersAPI implementation.
[Medium][API Design] The new JSON field is currentControlPlaneKubernetesVersion, but design 0014 and the other changed references document status.observedVersions.controlPlaneKubernetesVersion. Consumers following the design will query a field that is never populated; either align the API name or update the design and all examples before release.
Design uses incorrect observed Kubernetes version field name
Low β Documentation: the implementation defines this status field as status.observedVersions.currentControlPlaneKubernetesVersion (see pkg/apis/v1beta1/aksnodeclass_status.go:124-127), but the design document advertises controlPlaneKubernetesVersion throughout. Readers following this design will query a field that the API does not expose; update all references and the sample type to the implemented name, or rename the API consistently.
Severity: Medium β Category: API Design. Invalid or incompatible image pin requests are reported only through ImagesReady=False, but the later validation reconciler resets ValidationSucceeded to true on every pass (pkg/controllers/nodeclass/status/validation.go:127-129). This makes an unresolvable nodeImageVersion look like a valid spec to API consumers, whereas the design assigns NodeImageVersionInvalid and RollbackTargetKubernetesVersionMismatch to ValidationSucceeded; mark spec-level pin validation failures on ValidationSucceeded (while reserving ImagesReady for resolution failures) and test the final aggregate conditions.
Mark invalid Kubernetes versions as validation failures
Severity: Medium β Category: API Design. An invalid requested Kubernetes version only sets KubernetesVersionReady=False here, while the status controller later runs validation and unconditionally sets ValidationSucceeded=True (pkg/controllers/nodeclass/status/validation.go:127-129). Consequently a NodeClass with an invalid spec.versions.kubernetesVersion reports that validation succeeded, contrary to the design's condition contract and misleading consumers that use ValidationSucceeded to distinguish invalid spec from an incompatible effective version; set ValidationSucceeded=False for request-format failures (and cover the resulting condition).
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
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.
Fixes #1220
Description
This PR adds node image pinning, as described in doc 0014.
How was this change tested?
Standalone and E2Es. Tested by pinning version, pinning invalid versions, seeding recentlyUsed to simulate rollback. E2E Run: https://github.com/Azure/karpenter-provider-azure/actions/runs/35620834867/job/106403188039 (This is using FIt so the run is marked as failed, but the actual tests pass).
*
Does this change impact docs?
Release Note