-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Add ClusterClass patch engine #5534
✨ Add ClusterClass patch engine #5534
Conversation
b7ee1a5
to
bab2a17
Compare
bab2a17
to
da56357
Compare
da56357
to
06c4bc0
Compare
cc @vincepri @fabriziopandini @ykakarap @killianmuldoon @randomvariable @enxebre @schrej @vuil |
This is great @sbueringer!! 🚀 First pass at a high level review. Some high level suggestions:
Leaving this at a high level review for now as this PR is still a WIP (there are also a few TODOs in the code). Will do a full review once PR is ready. 🙂 |
Thx, so far! :) Some answers:
|
I probably won't be able to get round to a full review before Thursday due to other stuff going on, will queue up. |
06c4bc0
to
009c944
Compare
23fe99f
to
b247ec9
Compare
. "sigs.k8s.io/cluster-api/internal/matchers" | ||
) | ||
|
||
func TestApply(t *testing.T) { |
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.
I've currently only added one top-level unit test for engine.go
. It seems way simpler to just have a few more cases on that level compared to more or less duplicating the whole test setup for request
, applyPatchesToRequest
and updateDesiredState
. Please let's discuss if there are other opinions on that :)
"sigs.k8s.io/cluster-api/controllers/topology/internal/contract" | ||
) | ||
|
||
func TestCopySpec(t *testing.T) { |
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.
Similar to engine.go, I've only added one table test for copySpec. If preferred I can duplicate the test cases for the 3 patch funcs.
I thought testing copySpec covers the most cases and the 3 other funcs are transitively tested a lot by the tests in engine_test.go
PR should be ready for review now. (open TODOs are supposed to be solved in other PRs) (cc @ykakarap) |
6840cb9
to
e3adfc9
Compare
e81ad77
to
bf6dccd
Compare
Rebase on top of main, delta:
|
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.
@sbueringer great stuff!
Mostly nits; the only thing that requires some deep dive is the usage of mergepatch.
I still need to take a better look at test for the engine
docs/proposals/202105256-cluster-class-and-managed-topologies.md
Outdated
Show resolved
Hide resolved
controllers/topology/internal/extensions/patches/variables/variables.go
Outdated
Show resolved
Hide resolved
controllers/topology/internal/extensions/patches/variables/variables.go
Outdated
Show resolved
Hide resolved
controllers/topology/internal/extensions/patches/engine_test.go
Outdated
Show resolved
Hide resolved
controllers/topology/internal/extensions/patches/engine_test.go
Outdated
Show resolved
Hide resolved
controllers/topology/internal/extensions/patches/api/interface.go
Outdated
Show resolved
Hide resolved
0dca2b5
to
17d5386
Compare
17d5386
to
a4dc339
Compare
lgtm pending squash. great stuff! |
Signed-off-by: Stefan Büringer [email protected] Co-authored-by: fabriziopandini <[email protected]>
3768cca
to
1c52899
Compare
Done :) |
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
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
What this PR does / why we need it:
This PR implements the patch engine and variable calculation described in "Applying Patches" in: #5460 (Note: there are also code walkthroughs linked in the issue, the second one ~ still matches the code from this PR).
Goal of this PR is to add the patch engine and variable calculation.
The implementation for the inline JSON patches will be added after this PR has been merged via #5583.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #