Skip to content
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

Conversation

vincepri
Copy link
Member

Signed-off-by: Vince Prignano vincepri@vmware.com

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 22, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 22, 2021
@vincepri vincepri force-pushed the clusterclass-controlplane-alignment branch from 917e0b9 to 2d00abb Compare July 22, 2021 17:46
@vincepri vincepri force-pushed the clusterclass-controlplane-alignment branch 2 times, most recently from f52afe1 to 3de70e1 Compare July 22, 2021 19:58
@vincepri
Copy link
Member Author

vincepri commented Jul 22, 2021

@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 <vincepri@vmware.com>
@vincepri vincepri force-pushed the clusterclass-controlplane-alignment branch from 3de70e1 to 509daea Compare July 22, 2021 20:11
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2021
Metadata ObjectMeta `json:"metadata,omitempty"`

// LocalObjectTemplate contains the reference to the control plane provider.
LocalObjectTemplate `json:",inline"`
Copy link
Contributor

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?

Copy link
Member

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)

Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor

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?

@fabriziopandini
Copy link
Member

/lgtm

@vincepri
Copy link
Member Author

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2021
@vincepri
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 23, 2021

@vincepri: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
pull-cluster-api-apidiff-main 509daea link /test pull-cluster-api-apidiff-main

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.

@k8s-ci-robot k8s-ci-robot merged commit c1f399c into kubernetes-sigs:master Jul 23, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants