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

🐛 fix ClusterClass control plane infrastructure machine template rotation #5158

Conversation

sbueringer
Copy link
Member

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:
I tested a template rotation locally and it failed. It failed because the name of the new template was invalid. getClusterName returns an empty string, so this results in a name like -controlplane-s13ds1.

Note: ClusterName in ObjectMeta is not used by CAPI. Go doc:

	// The name of the cluster which the object belongs to.
	// This is used to distinguish resources with same name and namespace in different clusters.
	// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
	// +optional
	ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,15,opt,name=clusterName"`

I adjusted the code accordingly.

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 26, 2021
@sbueringer sbueringer changed the title fix ClusterClass control plane infrastructure machine template rotation 🐛 fix ClusterClass control plane infrastructure machine template rotation Aug 26, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 26, 2021
@fabriziopandini
Copy link
Member

Good catch!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 26, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /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 Aug 26, 2021
@killianmuldoon
Copy link
Contributor

/lgtm - thanks for catching this! Good context about the ClusterName field too.

@fabriziopandini
Copy link
Member

/test pull-cluster-api-test-main-mink8s

@k8s-ci-robot k8s-ci-robot merged commit 9c92a8d into kubernetes-sigs:master Aug 26, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Aug 26, 2021
@sbueringer sbueringer deleted the pr-fix-clusterclass-controlplane-template-rotation branch August 26, 2021 14:04
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants