-
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
🌱 Align ClusterClass ControlPlane with the rest of the fields #5000
🌱 Align ClusterClass ControlPlane with the rest of the fields #5000
Conversation
917e0b9
to
2d00abb
Compare
f52afe1
to
3de70e1
Compare
@CecileRobertMichon @sbueringer @fabriziopandini This should be good to go |
This commits introduces ControlPlaneClass and allows users to set metadata fields for all control plane objects. It also adds fields to set infrastructure reference for Machine objects and clarifies what contracts the field expects from the control plane provider. Signed-off-by: Vince Prignano <[email protected]>
3de70e1
to
509daea
Compare
/lgtm |
Metadata ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// LocalObjectTemplate contains the reference to the control plane provider. | ||
LocalObjectTemplate `json:",inline"` |
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 am probably missing something but the LocalObjectTemplate
we have here refs to a ControlPlaneTemplate (Ex: KubeadmControlPlaneTemplate - will be introduced in #4904 ).
This ControlPlaneTemplate will internally refer to a machine infrastructure, isnt it?
Going back the kcp template example we have a machine infra ref at kcptemplate.spec.template.spec.machineTemplate.infrastructureRef
. How is this different from the new MachineInfrastructure
field?
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.
Imho both will reference the same InfrastructureMachineTemplate. This PR makes it explicit on the ClusterClass (i.e. you have to set the ref on the ClusterClass and inside the ControlPlaneTemplate)
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.
Exactly, we are making this explicit;
Also, according to the initial work on #5002, ClusterClass is always going to set the reference inside the ControlPlaneTemplate, so it is not required to set it in both places upfront
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.
Good that fits for my PR as I assume that the ref can be unset in the ControlPlane even if it is set in the ClusterClass.
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.
ClusterClass is always going to set the reference inside the ControlPlaneTemplate, so it is not required to set it in both places upfront
Good to know that we are doing this, however the kcptemplate.spec.template.spec.machineTemplate.infrastructureRef
is not an optional field. So are we expecting that the user set the filed both inside the ControlPlaneTemplate and inside the ClusterClass definition and also that both the fields point to the same thing?
We should throw an error incase they dont match, is it?
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
/retest |
@vincepri: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Signed-off-by: Vince Prignano [email protected]
What this PR does / why we need it:
This commits introduces ControlPlaneClass and allows users to set
metadata fields for all control plane objects. It also adds fields to
set infrastructure reference for Machine objects and clarifies what
contracts the field expects from the control plane provider.
NOTE: While this is technically a breaking change, it's a follow-up to #4928.
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 #
/assign @fabriziopandini @CecileRobertMichon