From dc488591e27af4bb214d69e6202a8e706f2fe1ba 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 --- .../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 ab4534973..4ff23c45d 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 @@ -657,7 +665,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 @@ -740,8 +752,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - - description: Phase - jsonPath: .status.phase + - jsonPath: .status.phase name: Phase type: string - description: Message @@ -4282,7 +4293,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 @@ -6333,7 +6348,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 @@ -7128,7 +7147,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 @@ -8554,7 +8577,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 @@ -8688,7 +8715,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 @@ -8749,7 +8780,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 @@ -9138,7 +9173,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 b24f255ef..c711170c3 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 @@ -657,7 +665,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 @@ -739,8 +751,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - - description: Phase - jsonPath: .status.phase + - jsonPath: .status.phase name: Phase type: string - description: Message @@ -4280,7 +4291,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 @@ -6329,7 +6344,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 @@ -7121,7 +7140,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 @@ -8546,7 +8569,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 @@ -8679,7 +8706,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 @@ -8739,7 +8770,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 @@ -9127,7 +9162,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 60f0358ce..df3d0e4e0 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"` @@ -1258,6 +1259,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"` @@ -1440,6 +1442,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"` @@ -1564,6 +1567,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"` @@ -1592,6 +1596,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"` @@ -1628,6 +1633,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"` @@ -2000,6 +2006,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"` @@ -2083,6 +2090,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"` @@ -2153,6 +2161,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"` @@ -2363,6 +2372,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"`