From b8aeef9f7705120d9f2fe7c71113e70c3ba15749 Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Wed, 7 Apr 2021 15:05:49 -0600 Subject: [PATCH] ceph: add status subresource to CRDS Signed-off-by: Blaine Gardner --- .../charts/rook-ceph/templates/resources.yaml | 26 +++++++++++++++++-- cluster/examples/kubernetes/ceph/crds.yaml | 26 +++++++++++++++++-- pkg/apis/ceph.rook.io/v1/types.go | 14 +++++++++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/cluster/charts/rook-ceph/templates/resources.yaml b/cluster/charts/rook-ceph/templates/resources.yaml index 8b1ceddf4..784459d45 100644 --- a/cluster/charts/rook-ceph/templates/resources.yaml +++ b/cluster/charts/rook-ceph/templates/resources.yaml @@ -320,6 +320,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -389,6 +391,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -4200,7 +4204,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" @@ -4708,6 +4713,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -5538,7 +5545,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" @@ -6081,6 +6089,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -6145,6 +6155,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7142,6 +7154,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7210,6 +7224,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7269,6 +7285,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7604,6 +7622,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -8132,6 +8152,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/cluster/examples/kubernetes/ceph/crds.yaml b/cluster/examples/kubernetes/ceph/crds.yaml index 0cecc5787..f29daec62 100644 --- a/cluster/examples/kubernetes/ceph/crds.yaml +++ b/cluster/examples/kubernetes/ceph/crds.yaml @@ -323,6 +323,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -392,6 +394,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -4203,7 +4207,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" @@ -4711,6 +4716,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -5541,7 +5548,8 @@ spec: type: object served: true storage: true - subresources: {} + subresources: + status: {} status: acceptedNames: kind: "" @@ -6084,6 +6092,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -6148,6 +6158,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7145,6 +7157,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7213,6 +7227,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7272,6 +7288,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -7607,6 +7625,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" @@ -8135,6 +8155,8 @@ spec: type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index a537cc2c0..35d8a1628 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -42,6 +42,7 @@ import ( // +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` +// +kubebuilder:subresource:status type CephCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -539,6 +540,7 @@ type CrashCollectorSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephBlockPool represents a Ceph Storage Pool +// +kubebuilder:subresource:status type CephBlockPool struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -885,6 +887,7 @@ type ErasureCodedSpec struct { // CephFilesystem represents a Ceph Filesystem // +kubebuilder:printcolumn:name="ActiveMDS",type=string,JSONPath=`.spec.metadataServer.activeCount`,description="Number of desired active MDS daemons" // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:subresource:status type CephFilesystem struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -980,6 +983,7 @@ type FSMirroringSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephObjectStore represents a Ceph Object Store Gateway +// +kubebuilder:subresource:status type CephObjectStore struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1131,11 +1135,12 @@ type BucketStatus struct { LastChanged string `json:"lastChanged,omitempty"` } +// CephObjectStoreUser represents a Ceph Object Store Gateway User // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:shortName=rcou;objectuser -// CephObjectStoreUser represents a Ceph Object Store Gateway User +// +kubebuilder:subresource:status type CephObjectStoreUser struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1177,6 +1182,7 @@ type ObjectStoreUserSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status type CephObjectRealm struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1210,6 +1216,7 @@ type PullSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status type CephObjectZoneGroup struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1237,6 +1244,7 @@ type ObjectZoneGroupSpec struct { // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status type CephObjectZone struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1271,6 +1279,7 @@ type ObjectZoneSpec struct { // +genclient:noStatus // +kubebuilder:resource:shortName=nfs,path=cephnfses // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status type CephNFS struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1397,6 +1406,7 @@ type DisruptionManagementSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephClient represents a Ceph Client +// +kubebuilder:subresource:status type CephClient struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1479,6 +1489,7 @@ type SanitizeDisksSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephRBDMirror represents a Ceph RBD Mirror +// +kubebuilder:subresource:status type CephRBDMirror struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -1548,6 +1559,7 @@ type RBDMirroringPeerSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephFilesystemMirror is the Ceph Filesystem Mirror object definition +// +kubebuilder:subresource:status type CephFilesystemMirror struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"`