From e416fcbebf964bff8f7961f30f03df6939d6d97a Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Mon, 13 May 2024 09:42:52 +0530 Subject: [PATCH] api: Add new feild for supporting the cephfs encrypted storageclass Signed-off-by: Nitin Goyal --- api/v1/storagecluster_types.go | 17 ++++++++++++++++- .../bases/ocs.openshift.io_storageclusters.yaml | 14 ++++++++++++++ .../ocs/ocs.openshift.io_storageclusters.yaml | 14 ++++++++++++++ .../manifests/storagecluster.crd.yaml | 14 ++++++++++++++ .../api/v4/v1/storagecluster_types.go | 17 ++++++++++++++++- .../api/v4/v1/storagecluster_types.go | 17 ++++++++++++++++- 6 files changed, 90 insertions(+), 3 deletions(-) diff --git a/api/v1/storagecluster_types.go b/api/v1/storagecluster_types.go index a576d64a34..dbdc44d894 100644 --- a/api/v1/storagecluster_types.go +++ b/api/v1/storagecluster_types.go @@ -456,18 +456,33 @@ type EncryptionSpec struct { Enable bool `json:"enable,omitempty"` // +optional ClusterWide bool `json:"clusterWide,omitempty"` + // Configure the default rbd encrypted storage class // +optional StorageClass bool `json:"storageClass,omitempty"` // StorageClassName specifies the name of the storage class created for ceph encrypted block pools // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` + // Configure the default CephFS encrypted storage class + // +optional + CephFs DefaultStorageClassSpec `json:"cephfs,omitempty"` KeyManagementService KeyManagementServiceSpec `json:"kms,omitempty"` // KeyRotation defines options for Key Rotation. // +optional KeyRotation KeyRotationSpec `json:"keyRotation,omitempty"` } +type DefaultStorageClassSpec struct { + // Enable Default StorageClass + // +optional + StorageClass bool `json:"storageClass,omitempty"` + // StorageClassName specifies the name of the storage class + // +optional + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + StorageClassName string `json:"storageClassName,omitempty"` +} + // KeyRotationSpec represents the settings for Key Rotation. type KeyRotationSpec struct { // Enable represents whether the key rotation is enabled. diff --git a/config/crd/bases/ocs.openshift.io_storageclusters.yaml b/config/crd/bases/ocs.openshift.io_storageclusters.yaml index 6b94c99c7f..9f41db57b1 100644 --- a/config/crd/bases/ocs.openshift.io_storageclusters.yaml +++ b/config/crd/bases/ocs.openshift.io_storageclusters.yaml @@ -567,6 +567,19 @@ spec: description: EncryptionSpec defines if encryption should be enabled for the Storage Cluster It is optional and defaults to false. properties: + cephfs: + description: Configure the default CephFS encrypted storage class + properties: + storageClass: + description: Enable Default StorageClass + type: boolean + storageClassName: + description: StorageClassName specifies the name of the storage + class + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + type: object clusterWide: type: boolean enable: @@ -595,6 +608,7 @@ spec: type: boolean type: object storageClass: + description: Configure the default rbd encrypted storage class type: boolean storageClassName: description: StorageClassName specifies the name of the storage diff --git a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml index 6b94c99c7f..9f41db57b1 100644 --- a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml +++ b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml @@ -567,6 +567,19 @@ spec: description: EncryptionSpec defines if encryption should be enabled for the Storage Cluster It is optional and defaults to false. properties: + cephfs: + description: Configure the default CephFS encrypted storage class + properties: + storageClass: + description: Enable Default StorageClass + type: boolean + storageClassName: + description: StorageClassName specifies the name of the storage + class + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + type: object clusterWide: type: boolean enable: @@ -595,6 +608,7 @@ spec: type: boolean type: object storageClass: + description: Configure the default rbd encrypted storage class type: boolean storageClassName: description: StorageClassName specifies the name of the storage diff --git a/deploy/ocs-operator/manifests/storagecluster.crd.yaml b/deploy/ocs-operator/manifests/storagecluster.crd.yaml index bbdc5bd8a2..60b5b59524 100644 --- a/deploy/ocs-operator/manifests/storagecluster.crd.yaml +++ b/deploy/ocs-operator/manifests/storagecluster.crd.yaml @@ -566,6 +566,19 @@ spec: description: EncryptionSpec defines if encryption should be enabled for the Storage Cluster It is optional and defaults to false. properties: + cephfs: + description: Configure the default CephFS encrypted storage class + properties: + storageClass: + description: Enable Default StorageClass + type: boolean + storageClassName: + description: StorageClassName specifies the name of the storage + class + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + type: object clusterWide: type: boolean enable: @@ -594,6 +607,7 @@ spec: type: boolean type: object storageClass: + description: Configure the default rbd encrypted storage class type: boolean storageClassName: description: StorageClassName specifies the name of the storage diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go index a576d64a34..dbdc44d894 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go @@ -456,18 +456,33 @@ type EncryptionSpec struct { Enable bool `json:"enable,omitempty"` // +optional ClusterWide bool `json:"clusterWide,omitempty"` + // Configure the default rbd encrypted storage class // +optional StorageClass bool `json:"storageClass,omitempty"` // StorageClassName specifies the name of the storage class created for ceph encrypted block pools // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` + // Configure the default CephFS encrypted storage class + // +optional + CephFs DefaultStorageClassSpec `json:"cephfs,omitempty"` KeyManagementService KeyManagementServiceSpec `json:"kms,omitempty"` // KeyRotation defines options for Key Rotation. // +optional KeyRotation KeyRotationSpec `json:"keyRotation,omitempty"` } +type DefaultStorageClassSpec struct { + // Enable Default StorageClass + // +optional + StorageClass bool `json:"storageClass,omitempty"` + // StorageClassName specifies the name of the storage class + // +optional + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + StorageClassName string `json:"storageClassName,omitempty"` +} + // KeyRotationSpec represents the settings for Key Rotation. type KeyRotationSpec struct { // Enable represents whether the key rotation is enabled. diff --git a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go index a576d64a34..dbdc44d894 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go @@ -456,18 +456,33 @@ type EncryptionSpec struct { Enable bool `json:"enable,omitempty"` // +optional ClusterWide bool `json:"clusterWide,omitempty"` + // Configure the default rbd encrypted storage class // +optional StorageClass bool `json:"storageClass,omitempty"` // StorageClassName specifies the name of the storage class created for ceph encrypted block pools // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` + // Configure the default CephFS encrypted storage class + // +optional + CephFs DefaultStorageClassSpec `json:"cephfs,omitempty"` KeyManagementService KeyManagementServiceSpec `json:"kms,omitempty"` // KeyRotation defines options for Key Rotation. // +optional KeyRotation KeyRotationSpec `json:"keyRotation,omitempty"` } +type DefaultStorageClassSpec struct { + // Enable Default StorageClass + // +optional + StorageClass bool `json:"storageClass,omitempty"` + // StorageClassName specifies the name of the storage class + // +optional + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + StorageClassName string `json:"storageClassName,omitempty"` +} + // KeyRotationSpec represents the settings for Key Rotation. type KeyRotationSpec struct { // Enable represents whether the key rotation is enabled.