-
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
🌱 Webhooks: make MDT.replicas and autoscaler mut. exclusive #10370
🌱 Webhooks: make MDT.replicas and autoscaler mut. exclusive #10370
Conversation
/area clusterclass |
01f466e
to
7bca522
Compare
/cc @sbueringer |
Thx! |
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.
Just a few smaller findings
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.
aside from @sbueringer 's questions, i think the logic makes sense to me.
7bca522
to
1edc35d
Compare
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.
Thank you!
Last one from my side
Add new validation functions in cluster.go and clusterclass.go: - ValidateAutoscalerAnnotationsForCluster - ValidateAutoscalerAnnotationsForClusterClass ..ForCluster is called from validateTopology(). It makes sure that a given Topology does not contain MachineDeploymentToplogy objects under Workers, that have both a "replicas" field set to non-nil and an autoscaler min/max annotation present. Also optionally it checks if there are annotations that are set on the ClusterClass's MachineDeploymentClass for this MachineDeploymentTopology. ..ForClusterClass accepts a list of Clusters that use a certain ClusterClass. Inline, it uses the ..ForCluster function and the same validation as above is performed. It is called from validate() for a CC on update. Additionally: - Add a new builder utility function MachineDeploymentTopologyBuilder#WithAnnotations(). - Add 100% test coverage for the new validation functions.
1edc35d
to
e035135
Compare
Thx! /lgtm /assign @fabriziopandini @chrischdi |
LGTM label has been added. Git tree hash: bc7169f6b5a5bef7f002b70c0d29f224c1e3aa91
|
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.
/approve
Thanks for improving this! 🎉
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi 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:
Add new validation functions in cluster.go
and clusterclass.go:
..ForCluster is called from validateTopology().
It makes sure that a given Topology does not contain
MachineDeploymentToplogy objects under Workers, that have
both a "replicas" field set to non-nil and autoscaler
min/max annotations present.
Also optionally it checks if there are annotations that are set
on the ClusterClass's MachineDeploymentClass for this
MachineDeploymentTopology.
..ForClusterClass accepts a list of Clusters that use
a certain ClusterClass. Inline, it uses the ..ForCluster
function and the same validation as above is performed.
It is called from validate() for a CC on update.
Additionally:
MachineDeploymentTopologyBuilder#WithAnnotations().
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 #10343