Skip to content

Commit

Permalink
Merge pull request #5334 from budhirajamadhav/addClusterName
Browse files Browse the repository at this point in the history
🌱 Add cluster name on printer column on non core types
  • Loading branch information
k8s-ci-robot authored Sep 29, 2021
2 parents fc48062 + 3d6d314 commit 573f005
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfig"

// KubeadmConfig is the Schema for the kubeadmconfigs API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: Cluster
jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
name: Cluster
type: string
- description: Time duration since creation of KubeadmConfig
jsonPath: .metadata.creationTimestamp
name: Age
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/cluster.x-k8s.io_machinepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,10 @@ spec:
statusReplicasPath: .status.replicas
status: {}
- additionalPrinterColumns:
- description: Cluster
jsonPath: .spec.clusterName
name: Cluster
type: string
- description: MachinePool replicas count
jsonPath: .status.replicas
name: Replicas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Initialized",type=boolean,JSONPath=".status.initialized",description="This denotes whether or not the control plane has the uploaded kubeadm-config configmap"
// +kubebuilder:printcolumn:name="API Server Available",type=boolean,JSONPath=".status.ready",description="KubeadmControlPlane API Server is ready to receive requests"
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this control plane"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,10 @@ spec:
statusReplicasPath: .status.replicas
status: {}
- additionalPrinterColumns:
- description: Cluster
jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
name: Cluster
type: string
- description: This denotes whether or not the control plane has the uploaded
kubeadm-config configmap
jsonPath: .status.initialized
Expand Down
1 change: 1 addition & 0 deletions exp/api/v1beta1/machinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase {
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster"
// +kubebuilder:printcolumn:name="Replicas",type="string",JSONPath=".status.replicas",description="MachinePool replicas count"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachinePool status such as Terminating/Pending/Provisioning/Running/Failed etc"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerCluster"

// DockerCluster is the Schema for the dockerclusters API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachine"

// DockerMachine is the Schema for the dockermachines API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: Cluster
jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
name: Cluster
type: string
- description: Time duration since creation of DockerCluster
jsonPath: .metadata.creationTimestamp
name: Age
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: Cluster
jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
name: Cluster
type: string
- description: Time duration since creation of DockerMachine
jsonPath: .metadata.creationTimestamp
name: Age
Expand Down

0 comments on commit 573f005

Please sign in to comment.