Skip to content

Commit

Permalink
crd: replace backendStoreDriver with dataEngine
Browse files Browse the repository at this point in the history
Longhorn 7095

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit authored and David Ko committed Dec 28, 2023
1 parent 381122e commit 6208527
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
38 changes: 28 additions & 10 deletions k8s/crds.yaml
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1688,6 +1691,9 @@ spec:
spec:
properties:
backendStoreDriver:
description: Deprecated.
type: string
dataEngine:
type: string
name:
type: string
Expand Down Expand Up @@ -1727,6 +1733,9 @@ spec:
spec:
properties:
backendStoreDriver:
description: Deprecated.
type: string
dataEngine:
type: string
name:
type: string
Expand Down Expand Up @@ -1766,6 +1775,9 @@ spec:
spec:
properties:
backendStoreDriver:
description: Deprecated.
type: string
dataEngine:
type: string
name:
type: string
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -3466,9 +3481,7 @@ spec:
- rwx
type: string
backendStoreDriver:
enum:
- v1
- v2
description: Deprecated.
type: string
backingImage:
type: string
Expand All @@ -3478,6 +3491,11 @@ spec:
- lz4
- gzip
type: string
dataEngine:
enum:
- v1
- v2
type: string
dataLocality:
enum:
- disabled
Expand Down
12 changes: 9 additions & 3 deletions k8s/pkg/apis/longhorn/v1beta2/instancemanager.go
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`

Expand Down
14 changes: 13 additions & 1 deletion k8s/pkg/apis/longhorn/v1beta2/volume.go
Expand Up @@ -160,6 +160,7 @@ const (
ReplicaDiskSoftAntiAffinityDisabled = ReplicaDiskSoftAntiAffinity("disabled")
)

// Deprecated.
type BackendStoreDriverType string

const (
Expand All @@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6208527

Please sign in to comment.