From 6208527e3ba5037a7a594fd32226d3ed788428d5 Mon Sep 17 00:00:00 2001 From: Derek Su Date: Tue, 26 Dec 2023 17:06:32 +0000 Subject: [PATCH] crd: replace backendStoreDriver with dataEngine Longhorn 7095 Signed-off-by: Derek Su --- k8s/crds.yaml | 38 ++++++++++++++----- .../apis/longhorn/v1beta2/instancemanager.go | 12 ++++-- k8s/pkg/apis/longhorn/v1beta2/volume.go | 14 ++++++- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/k8s/crds.yaml b/k8s/crds.yaml index 40a17c5668..46579068c6 100644 --- a/k8s/crds.yaml +++ b/k8s/crds.yaml @@ -1313,12 +1313,15 @@ spec: active: type: boolean backendStoreDriver: + description: Deprecated. + type: string + backupVolume: + type: string + dataEngine: enum: - v1 - v2 type: string - backupVolume: - type: string desireState: type: string disableFrontend: @@ -1634,7 +1637,7 @@ spec: name: Type type: string - description: The data engine of the instance manager - jsonPath: .spec.backendStoreDriver + jsonPath: .spec.dataEngine name: Data Engine type: string - description: The node that the instance manager is running on @@ -1660,7 +1663,7 @@ spec: spec: description: InstanceManagerSpec defines the desired state of the Longhorn instancer manager properties: - backendStoreDriver: + dataEngine: type: string image: type: string @@ -1688,6 +1691,9 @@ spec: spec: properties: backendStoreDriver: + description: Deprecated. + type: string + dataEngine: type: string name: type: string @@ -1727,6 +1733,9 @@ spec: spec: properties: backendStoreDriver: + description: Deprecated. + type: string + dataEngine: type: string name: type: string @@ -1766,6 +1775,9 @@ spec: spec: properties: backendStoreDriver: + description: Deprecated. + type: string + dataEngine: type: string name: type: string @@ -2437,14 +2449,17 @@ spec: active: type: boolean backendStoreDriver: - enum: - - v1 - - v2 + description: Deprecated. type: string backingImage: type: string dataDirectoryName: type: string + dataEngine: + enum: + - v1 + - v2 + type: string desireState: type: string diskID: @@ -3466,9 +3481,7 @@ spec: - rwx type: string backendStoreDriver: - enum: - - v1 - - v2 + description: Deprecated. type: string backingImage: type: string @@ -3478,6 +3491,11 @@ spec: - lz4 - gzip type: string + dataEngine: + enum: + - v1 + - v2 + type: string dataLocality: enum: - disabled diff --git a/k8s/pkg/apis/longhorn/v1beta2/instancemanager.go b/k8s/pkg/apis/longhorn/v1beta2/instancemanager.go index 2058a6ca2a..21da039615 100644 --- a/k8s/pkg/apis/longhorn/v1beta2/instancemanager.go +++ b/k8s/pkg/apis/longhorn/v1beta2/instancemanager.go @@ -47,8 +47,11 @@ type InstanceProcess struct { type InstanceProcessSpec struct { // +optional Name string `json:"name"` + // Deprecated. // +optional BackendStoreDriver BackendStoreDriverType `json:"backendStoreDriver"` + // +optional + DataEngine DataEngineType `json:"dataEngine"` } type InstanceState string @@ -81,9 +84,12 @@ type InstanceSpec struct { LogRequested bool `json:"logRequested"` // +optional SalvageRequested bool `json:"salvageRequested"` - // +kubebuilder:validation:Enum=v1;v2 + // Deprecated. // +optional BackendStoreDriver BackendStoreDriverType `json:"backendStoreDriver"` + // +kubebuilder:validation:Enum=v1;v2 + // +optional + DataEngine DataEngineType `json:"dataEngine"` } type InstanceStatus struct { @@ -142,7 +148,7 @@ type InstanceManagerSpec struct { // +optional Type InstanceManagerType `json:"type"` // +optional - BackendStoreDriver BackendStoreDriverType `json:"backendStoreDriver"` + DataEngine DataEngineType `json:"dataEngine"` } // InstanceManagerStatus defines the observed state of the Longhorn instance manager @@ -181,7 +187,7 @@ type InstanceManagerStatus struct { // +kubebuilder:storageversion // +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.currentState`,description="The state of the instance manager" // +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`,description="The type of the instance manager (engine or replica)" -// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.backendStoreDriver`,description="The data engine of the instance manager" +// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the instance manager" // +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.nodeID`,description="The node that the instance manager is running on" // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` diff --git a/k8s/pkg/apis/longhorn/v1beta2/volume.go b/k8s/pkg/apis/longhorn/v1beta2/volume.go index 5e210b0d47..e322bb1ed6 100644 --- a/k8s/pkg/apis/longhorn/v1beta2/volume.go +++ b/k8s/pkg/apis/longhorn/v1beta2/volume.go @@ -160,6 +160,7 @@ const ( ReplicaDiskSoftAntiAffinityDisabled = ReplicaDiskSoftAntiAffinity("disabled") ) +// Deprecated. type BackendStoreDriverType string const ( @@ -168,6 +169,14 @@ const ( BackendStoreDriverTypeAll = BackendStoreDriverType("all") ) +type DataEngineType string + +const ( + DataEngineTypeV1 = DataEngineType("v1") + DataEngineTypeV2 = DataEngineType("v2") + DataEngineTypeAll = DataEngineType("all") +) + type OfflineReplicaRebuilding string const ( @@ -274,9 +283,12 @@ type VolumeSpec struct { // +kubebuilder:validation:Enum=none;lz4;gzip // +optional BackupCompressionMethod BackupCompressionMethod `json:"backupCompressionMethod"` - // +kubebuilder:validation:Enum=v1;v2 + // Deprecated. // +optional BackendStoreDriver BackendStoreDriverType `json:"backendStoreDriver"` + // +kubebuilder:validation:Enum=v1;v2 + // +optional + DataEngine DataEngineType `json:"dataEngine"` // OfflineReplicaRebuilding is used to determine if the offline replica rebuilding feature is enabled or not // +kubebuilder:validation:Enum=ignored;disabled;enabled // +optional