-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASOAPI: add resource mutator framework #4793
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4793 +/- ##
==========================================
+ Coverage 62.48% 62.60% +0.12%
==========================================
Files 196 198 +2
Lines 16188 16285 +97
==========================================
+ Hits 10115 10196 +81
- Misses 5333 5343 +10
- Partials 740 746 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall on first pass! Just some questions on my end and I'll go through this again to understand everything better.
/hold to squash fixups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
My only thoughts for the future would be to make it a bit more explicit in the libraries (rename exported methods?) that what we're doing here assumes RAW JSON, or to generalize and implement for RAW JSON, while allowing pluggable data structures as well in the future.
LGTM label has been added. Git tree hash: fd7280a0e3d5ddeb182446bdf887bc2033c2bbda
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jackfrancis The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
squashed! |
/lgtm @nojnhuh Just checking: Did you mean to squash to 3 commits? |
Yes, I think each one is distinct enough to warrant staying separate. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The main gap in the ASOAPI implementations at the moment is that certain parts of the CAPI API that map to Azure resource parameters, like MachinePool spec.replicas -> ManagedClustersAgentPool spec.count, are not ultimately propagated to ASO. This PR adds a framework for making those kinds of transformations and a few examples.
The way this works is roughly:
spec.resources
are reconciled, some functions can be run to inject/modify values to the ASO resources (mutators.ApplyMutators()
).spec.version
and an embeddedManagedCluster'sspec.kubernetesVersion
), and to maintain the philosophy thatspec
is what's defined by the user.spec.template.spec.version
, are nil, CAPZ will allow users to define the equivalent field on the ASO resource (ManagedClustersAgentPool'sspec.orchestratorVersion
) to any value allowed by Azure. In this context of a node pool's Kubernetes version, this allows users to leverage the AKS API's flexibility to define only MAJOR.MINOR versions which aren't allowed in the MachinePool API (Allow omitting the k8s patch version inazuremanagedcontrolplanes
#4111).Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #4713
Special notes for your reviewer:
TODOs:
Release note: