From eaa0bfe4969d2bf88e960caaa88ce70c4bdecc80 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Tue, 15 Mar 2022 11:41:58 +0530 Subject: [PATCH] core: add `Phase` in `additionalPrinterColumns` for all CRs this commit adding `Phase` in `additionalPrinterColumns` for all the CRs. this is how it looks now, example: ``` $ kc get cephfilesystem NAME ACTIVEMDS AGE PHASE myfs 1 4m57s Ready srai@ ~ $ kc get cephblockpool NAME PHASE device-health-metrics Ready replicapool Progressing srai@ ~ $ kc get cephclient NAME PHASE cinder Ready glance Ready ``` Closes: https://github.com/rook/rook/issues/9883 Signed-off-by: subhamkrai (cherry picked from commit dc488591e27af4bb214d69e6202a8e706f2fe1ba) --- .../charts/rook-ceph/templates/resources.yaml | 63 +++++++++++++++---- deploy/examples/crds.yaml | 63 +++++++++++++++---- pkg/apis/ceph.rook.io/v1/types.go | 12 +++- 3 files changed, 113 insertions(+), 25 deletions(-) diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index fd4050096..dd6dfd154 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -16,7 +16,11 @@ spec: singular: cephblockpool scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephBlockPool represents a Ceph Storage Pool @@ -510,7 +514,11 @@ spec: singular: cephbuckettopic scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephBucketTopic represents a Ceph Object Topic for Bucket Notifications @@ -654,7 +662,11 @@ spec: singular: cephclient scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephClient represents a Ceph Client @@ -737,8 +749,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - - description: Phase - jsonPath: .status.phase + - jsonPath: .status.phase name: Phase type: string - description: Message @@ -4258,7 +4269,11 @@ spec: singular: cephfilesystemmirror scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephFilesystemMirror is the Ceph Filesystem Mirror object definition @@ -6117,7 +6132,11 @@ spec: singular: cephfilesystemsubvolumegroup scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephFilesystemSubVolumeGroup represents a Ceph Filesystem SubVolumeGroup @@ -6912,7 +6931,11 @@ spec: singular: cephobjectstore scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectStore represents a Ceph Object Store Gateway @@ -8338,7 +8361,11 @@ spec: singular: cephobjectstoreuser scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectStoreUser represents a Ceph Object Store Gateway User @@ -8472,7 +8499,11 @@ spec: singular: cephobjectzonegroup scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectZoneGroup represents a Ceph Object Store Gateway Zone Group @@ -8533,7 +8564,11 @@ spec: singular: cephobjectzone scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectZone represents a Ceph Object Store Gateway Zone @@ -8922,7 +8957,11 @@ spec: singular: cephrbdmirror scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephRBDMirror represents a Ceph RBD Mirror diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index 234fa23bf..6aaec7d3d 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -19,7 +19,11 @@ spec: singular: cephblockpool scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephBlockPool represents a Ceph Storage Pool @@ -511,7 +515,11 @@ spec: singular: cephbuckettopic scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephBucketTopic represents a Ceph Object Topic for Bucket Notifications @@ -654,7 +662,11 @@ spec: singular: cephclient scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephClient represents a Ceph Client @@ -736,8 +748,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - - description: Phase - jsonPath: .status.phase + - jsonPath: .status.phase name: Phase type: string - description: Message @@ -4256,7 +4267,11 @@ spec: singular: cephfilesystemmirror scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephFilesystemMirror is the Ceph Filesystem Mirror object definition @@ -6113,7 +6128,11 @@ spec: singular: cephfilesystemsubvolumegroup scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephFilesystemSubVolumeGroup represents a Ceph Filesystem SubVolumeGroup @@ -6905,7 +6924,11 @@ spec: singular: cephobjectstore scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectStore represents a Ceph Object Store Gateway @@ -8330,7 +8353,11 @@ spec: singular: cephobjectstoreuser scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectStoreUser represents a Ceph Object Store Gateway User @@ -8463,7 +8490,11 @@ spec: singular: cephobjectzonegroup scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectZoneGroup represents a Ceph Object Store Gateway Zone Group @@ -8523,7 +8554,11 @@ spec: singular: cephobjectzone scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephObjectZone represents a Ceph Object Store Gateway Zone @@ -8911,7 +8946,11 @@ spec: singular: cephrbdmirror scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + name: v1 schema: openAPIV3Schema: description: CephRBDMirror represents a Ceph RBD Mirror diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 14e194536..a506af6f2 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -38,7 +38,7 @@ import ( // +kubebuilder:printcolumn:name="DataDirHostPath",type=string,JSONPath=`.spec.dataDirHostPath`,description="Directory used on the K8s nodes" // +kubebuilder:printcolumn:name="MonCount",type=string,JSONPath=`.spec.mon.count`,description="Number of MONs" // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` -// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="Phase" +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.message`,description="Message" // +kubebuilder:printcolumn:name="Health",type=string,JSONPath=`.status.ceph.health`,description="Ceph Health" // +kubebuilder:printcolumn:name="External",type=boolean,JSONPath=`.spec.external.enable` @@ -567,6 +567,7 @@ type CrashCollectorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephBlockPool represents a Ceph Storage Pool +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephBlockPool struct { metav1.TypeMeta `json:",inline"` @@ -1252,6 +1253,7 @@ type PeerStatSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephObjectStore represents a Ceph Object Store Gateway +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephObjectStore struct { metav1.TypeMeta `json:",inline"` @@ -1434,6 +1436,7 @@ type BucketStatus struct { // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:shortName=rcou;objectuser +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephObjectStoreUser struct { metav1.TypeMeta `json:",inline"` @@ -1558,6 +1561,7 @@ type PullSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephObjectZoneGroup struct { metav1.TypeMeta `json:",inline"` @@ -1586,6 +1590,7 @@ type ObjectZoneGroupSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephObjectZone struct { metav1.TypeMeta `json:",inline"` @@ -1622,6 +1627,7 @@ type ObjectZoneSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephBucketTopic struct { metav1.TypeMeta `json:",inline"` @@ -1954,6 +1960,7 @@ type DisruptionManagementSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephClient represents a Ceph Client +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephClient struct { metav1.TypeMeta `json:",inline"` @@ -2037,6 +2044,7 @@ type SanitizeDisksSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephRBDMirror represents a Ceph RBD Mirror +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephRBDMirror struct { metav1.TypeMeta `json:",inline"` @@ -2107,6 +2115,7 @@ type MirroringPeerSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephFilesystemMirror is the Ceph Filesystem Mirror object definition +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephFilesystemMirror struct { metav1.TypeMeta `json:",inline"` @@ -2317,6 +2326,7 @@ type StorageClassDeviceSet struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephFilesystemSubVolumeGroup represents a Ceph Filesystem SubVolumeGroup +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` // +kubebuilder:subresource:status type CephFilesystemSubVolumeGroup struct { metav1.TypeMeta `json:",inline"`