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

🌱 Add cluster name on printer column on non core types #5334

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

BudhirajaMadhav
Copy link
Contributor

This PR will add clusterName as printer column on non core types

Fixes #5208

@k8s-ci-robot
Copy link
Contributor

Welcome @BudhirajaMadhav!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @BudhirajaMadhav. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 27, 2021
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 27, 2021
@BudhirajaMadhav BudhirajaMadhav changed the title Add cluster name on printer column on non core types🌱 🌱 Add cluster name on printer column on non core types Sep 27, 2021
@fabriziopandini
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 27, 2021
@fabriziopandini
Copy link
Member

/cc @sbueringer

@BudhirajaMadhav
Copy link
Contributor Author

Hey @fabriziopandini in the failed test of pull-cluster-api-verify-main it says generated files are out of date, run make generate. Should I make a commit after performing make generate?

@JoelSpeed
Copy link
Contributor

JoelSpeed commented Sep 28, 2021

Should I make a commit after performing make generate?

Yep that's correct, once you've run make generate there should be some differences to check in for the generated CRD manifests, these will need to be committed to fix the errors

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make the suggested changes, then run make generate and make -C test/infrastructure/docker generate-manifests (the test failed because the second one was missing) and then squash it all into one commit? Thank you :)

And sorry there was a bit of context missing in the corresponding issue.

P.S. It would be great to get this PR into the 1.0 release (aka ASAP merged :))

@@ -127,6 +127,7 @@ type KubeadmConfigStatus struct {
// +kubebuilder:resource:path=kubeadmconfigs,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

@@ -33,6 +33,7 @@ type KubeadmConfigTemplateResource struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=kubeadmconfigtemplates,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

We don't set a cluster-name label on this resource

Copy link
Member

@fabriziopandini fabriziopandini Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, also with ClusterClasses, templates are going to be shared across many clusters.

@@ -201,6 +201,7 @@ type KubeadmControlPlaneStatus struct {
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

@@ -28,6 +28,7 @@ type KubeadmControlPlaneTemplateSpec struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=kubeadmcontrolplanetemplates,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

We don't set a cluster-name label on this resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is a template introduced for ClusterClasses, so it is shared across many clusters.

@@ -97,6 +97,7 @@ type APIEndpoint struct {
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:object:root=true
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

@@ -27,6 +27,7 @@ type DockerClusterTemplateSpec struct {

// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

We don't set a cluster-name label on this resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is a template introduced for ClusterClasses, so it is shared across many clusters.

@@ -94,6 +94,7 @@ type DockerMachineStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

@@ -28,6 +28,7 @@ type DockerMachineTemplateSpec struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=dockermachinetemplates,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

We don't set a cluster-name label on this resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, also with ClusterClasses, templates are going to be shared across many clusters.

@@ -114,6 +114,7 @@ type DockerMachinePoolInstanceStatus struct {
// +kubebuilder:storageversion
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['machine\\.cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"

We don't set a cluster-name label on this resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to remove the column for now but I consider this a bug, let's open an issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done > #5340

@fabriziopandini
Copy link
Member

@BudhirajaMadhav if you can address comments we will try to get this into v1beta1 RC later today

@BudhirajaMadhav
Copy link
Contributor Author

Yup @fabriziopandini I will do the required changes today itself. Out now, but will do it asap.

@BudhirajaMadhav
Copy link
Contributor Author

BudhirajaMadhav commented Sep 28, 2021

Hey, @sbueringer if you're there I was about to commit the changes after doing the suggested changes and performing make generate. But it edited so many files. Is it fine? Should I commit. Sorry if I'm asking a bit too much. It's just my first contribution.

image

@sbueringer
Copy link
Member

sbueringer commented Sep 28, 2021

@BudhirajaMadhav No problem. Looks like there's something wrong with deepcopy/conversion generation. I'm not sure what, but can you try reset and run generate-manifests instead of generate (in the main folder and in ./test/infrastructure/docker)? This will not touch the deepcopy and conversion files.

Sorry I meant generate-manifests instead of generate in my post above.

@BudhirajaMadhav
Copy link
Contributor Author

BudhirajaMadhav commented Sep 28, 2021

Oho, no worries. I did make generate-manifests but I asked on slack and the thing was my go version was 1.17 and after performing make generate it added "Go:" to the first line of every conversion/deepcopy file. I even changed my version now, so that this kind of problem does not occur in future.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 28, 2021
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2021
@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 Sep 29, 2021
@k8s-ci-robot k8s-ci-robot merged commit 573f005 into kubernetes-sigs:main Sep 29, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Sep 29, 2021
@sbueringer
Copy link
Member

@BudhirajaMadhav Thx :)

@BudhirajaMadhav BudhirajaMadhav deleted the addClusterName branch September 29, 2021 09:25
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Add Cluster name as printer column on non core types
6 participants