diff --git a/api/v1/qdrantcluster_types.go b/api/v1/qdrantcluster_types.go index f6652d0..cb5bed0 100644 --- a/api/v1/qdrantcluster_types.go +++ b/api/v1/qdrantcluster_types.go @@ -14,15 +14,6 @@ const ( ResourceQdrantCluster = "qdrantclusters" ) -type OperatorVersion string - -const ( - // The operator written in Python - OperatorV1 OperatorVersion = "V1" - // The operator written in Go - OperatorV2 OperatorVersion = "V2" -) - const ( // The Annotation key to trigger a restart. RestartedAtAnnotationKey = "restartedAt" @@ -54,7 +45,6 @@ func GetQdrantClusterCrdForHash(qc QdrantCluster) QdrantCluster { cloned.ClusterManager = nil cloned.Distributed = false cloned.Ingress = nil - cloned.OperatorVersion = nil cloned.Pauses = nil cloned.Resources.Storage = "" cloned.Service = nil @@ -74,11 +64,6 @@ func GetQdrantClusterCrdForHash(qc QdrantCluster) QdrantCluster { // QdrantClusterSpec defines the desired state of QdrantCluster // +kubebuilder:pruning:PreserveUnknownFields type QdrantClusterSpec struct { - // The version of the operator which reconciles this instance - // +kubebuilder:validation:Enum=V1;V2 - // +kubebuilder:default=V1 - // +optional - OperatorVersion *OperatorVersion `json:"operatorVersion,omitempty"` // Id specifies the unique identifier of the cluster Id string `json:"id"` // Version specifies the version of Qdrant to deploy @@ -146,13 +131,6 @@ type QdrantClusterSpec struct { PodDisruptionBudget *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"` } -func (s QdrantClusterSpec) GetOperatorVersion() OperatorVersion { - if s.OperatorVersion == nil { - return OperatorV1 - } - return *s.OperatorVersion -} - // Validates if there are incorrect settings in the CRD func (s QdrantClusterSpec) Validate() error { if err := s.Resources.Validate("Spec.Resources"); err != nil { diff --git a/api/v1/qdrantclusterrestore_types.go b/api/v1/qdrantclusterrestore_types.go index c80054f..2b45f39 100644 --- a/api/v1/qdrantclusterrestore_types.go +++ b/api/v1/qdrantclusterrestore_types.go @@ -9,24 +9,12 @@ const ( // QdrantClusterRestoreSpec defines the desired state of QdrantClusterRestore type QdrantClusterRestoreSpec struct { - // The version of the operator which reconciles this instance - // +kubebuilder:validation:Enum=V1;V2 - // +kubebuilder:default=V1 - // +optional - OperatorVersion *OperatorVersion `json:"operatorVersion,omitempty"` // Source defines the source snapshot from which the restore will be done Source RestoreSource `json:"source"` // Destination defines the destination cluster where the source data will end up Destination RestoreDestination `json:"destination"` } -func (s QdrantClusterRestoreSpec) GetOperatorVersion() OperatorVersion { - if s.OperatorVersion == nil { - return OperatorV1 - } - return *s.OperatorVersion -} - type RestoreSource struct { // SnapshotName is the name of the snapshot from which we wish to restore SnapshotName string `json:"snapshotName"` diff --git a/api/v1/qdrantclusterscheduledsnapshot_types.go b/api/v1/qdrantclusterscheduledsnapshot_types.go index 3c817cf..f43e570 100644 --- a/api/v1/qdrantclusterscheduledsnapshot_types.go +++ b/api/v1/qdrantclusterscheduledsnapshot_types.go @@ -9,11 +9,6 @@ const ( // QdrantClusterScheduledSnapshotSpec defines the desired state of QdrantCluster type QdrantClusterScheduledSnapshotSpec struct { - // The version of the operator which reconciles this instance - // +kubebuilder:validation:Enum=V1;V2 - // +kubebuilder:default=V1 - // +optional - OperatorVersion *OperatorVersion `json:"operatorVersion,omitempty"` // Id specifies the unique identifier of the cluster ClusterId string `json:"cluster-id"` // Specifies short Id which identifies a schedule @@ -28,13 +23,6 @@ type QdrantClusterScheduledSnapshotSpec struct { Retention string `json:"retention"` } -func (s QdrantClusterScheduledSnapshotSpec) GetOperatorVersion() OperatorVersion { - if s.OperatorVersion == nil { - return OperatorV1 - } - return *s.OperatorVersion -} - type ScheduledSnapshotPhase string const ( diff --git a/api/v1/qdrantclustersnapshot_types.go b/api/v1/qdrantclustersnapshot_types.go index 040a66b..b06421e 100644 --- a/api/v1/qdrantclustersnapshot_types.go +++ b/api/v1/qdrantclustersnapshot_types.go @@ -8,11 +8,6 @@ const ( ) type QdrantClusterSnapshotSpec struct { - // The version of the operator which reconciles this instance - // +kubebuilder:validation:Enum=V1;V2 - // +kubebuilder:default=V1 - // +optional - OperatorVersion *OperatorVersion `json:"operatorVersion,omitempty"` // The cluster ID for which a Snapshot need to be taken // The cluster should be in the same namespace as this QdrantClusterSnapshot is located ClusterId string `json:"cluster-id"` @@ -31,13 +26,6 @@ type QdrantClusterSnapshotSpec struct { Retention *string `json:"retention,omitempty"` } -func (s QdrantClusterSnapshotSpec) GetOperatorVersion() OperatorVersion { - if s.OperatorVersion == nil { - return OperatorV1 - } - return *s.OperatorVersion -} - type QdrantClusterSnapshotPhase string const ( diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 11c7f47..3b4f8c7 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -494,7 +494,7 @@ func (in *QdrantClusterRestore) DeepCopyInto(out *QdrantClusterRestore) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) } @@ -551,11 +551,6 @@ func (in *QdrantClusterRestoreList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *QdrantClusterRestoreSpec) DeepCopyInto(out *QdrantClusterRestoreSpec) { *out = *in - if in.OperatorVersion != nil { - in, out := &in.OperatorVersion, &out.OperatorVersion - *out = new(OperatorVersion) - **out = **in - } out.Source = in.Source out.Destination = in.Destination } @@ -595,7 +590,7 @@ func (in *QdrantClusterScheduledSnapshot) DeepCopyInto(out *QdrantClusterSchedul *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) } @@ -652,11 +647,6 @@ func (in *QdrantClusterScheduledSnapshotList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *QdrantClusterScheduledSnapshotSpec) DeepCopyInto(out *QdrantClusterScheduledSnapshotSpec) { *out = *in - if in.OperatorVersion != nil { - in, out := &in.OperatorVersion, &out.OperatorVersion - *out = new(OperatorVersion) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantClusterScheduledSnapshotSpec. @@ -752,11 +742,6 @@ func (in *QdrantClusterSnapshotList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *QdrantClusterSnapshotSpec) DeepCopyInto(out *QdrantClusterSnapshotSpec) { *out = *in - if in.OperatorVersion != nil { - in, out := &in.OperatorVersion, &out.OperatorVersion - *out = new(OperatorVersion) - **out = **in - } if in.ScheduleShortId != nil { in, out := &in.ScheduleShortId, &out.ScheduleShortId *out = new(string) @@ -806,11 +791,6 @@ func (in *QdrantClusterSnapshotStatus) DeepCopy() *QdrantClusterSnapshotStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *QdrantClusterSpec) DeepCopyInto(out *QdrantClusterSpec) { *out = *in - if in.OperatorVersion != nil { - in, out := &in.OperatorVersion, &out.OperatorVersion - *out = new(OperatorVersion) - **out = **in - } if in.ClusterManager != nil { in, out := &in.ClusterManager, &out.ClusterManager *out = new(bool) diff --git a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterrestores.yaml b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterrestores.yaml index ea55d51..551d027 100644 --- a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterrestores.yaml +++ b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterrestores.yaml @@ -64,13 +64,6 @@ spec: - name - namespace type: object - operatorVersion: - default: V1 - description: The version of the operator which reconciles this instance - enum: - - V1 - - V2 - type: string source: description: Source defines the source snapshot from which the restore will be done diff --git a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusters.yaml b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusters.yaml index d0aec27..62e4581 100644 --- a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusters.yaml +++ b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusters.yaml @@ -324,13 +324,6 @@ spec: description: NodeSelector specifies the node selector for each Qdrant node. type: object - operatorVersion: - default: V1 - description: The version of the operator which reconciles this instance - enum: - - V1 - - V2 - type: string pauses: description: |- Pauses specifies a list of pause request by developer for manual maintenance. diff --git a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterscheduledsnapshots.yaml b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterscheduledsnapshots.yaml index 3ed64f9..4a53915 100644 --- a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterscheduledsnapshots.yaml +++ b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclusterscheduledsnapshots.yaml @@ -66,13 +66,6 @@ spec: cluster-id: description: Id specifies the unique identifier of the cluster type: string - operatorVersion: - default: V1 - description: The version of the operator which reconciles this instance - enum: - - V1 - - V2 - type: string retention: description: Retention of schedule in hours pattern: ^[0-9]+h$ diff --git a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclustersnapshots.yaml b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclustersnapshots.yaml index ec31d54..ae5b0ca 100644 --- a/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclustersnapshots.yaml +++ b/charts/qdrant-operator-crds/crds/qdrant.io_qdrantclustersnapshots.yaml @@ -65,13 +65,6 @@ spec: epoch format) format: int64 type: integer - operatorVersion: - default: V1 - description: The version of the operator which reconciles this instance - enum: - - V1 - - V2 - type: string retention: description: |- The retention period of this snapshot in hours, if any. diff --git a/docs/api.md b/docs/api.md index 53695cf..8f32700 100644 --- a/docs/api.md +++ b/docs/api.md @@ -299,22 +299,6 @@ _Appears in:_ -#### OperatorVersion - -_Underlying type:_ _string_ - - - - - -_Appears in:_ -- [QdrantClusterRestoreSpec](#qdrantclusterrestorespec) -- [QdrantClusterScheduledSnapshotSpec](#qdrantclusterscheduledsnapshotspec) -- [QdrantClusterSnapshotSpec](#qdrantclustersnapshotspec) -- [QdrantClusterSpec](#qdrantclusterspec) - - - #### Pause @@ -477,7 +461,6 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `operatorVersion` _[OperatorVersion](#operatorversion)_ | The version of the operator which reconciles this instance | V1 | Enum: [V1 V2]
| | `source` _[RestoreSource](#restoresource)_ | Source defines the source snapshot from which the restore will be done | | | | `destination` _[RestoreDestination](#restoredestination)_ | Destination defines the destination cluster where the source data will end up | | | @@ -534,7 +517,6 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `operatorVersion` _[OperatorVersion](#operatorversion)_ | The version of the operator which reconciles this instance | V1 | Enum: [V1 V2]
| | `cluster-id` _string_ | Id specifies the unique identifier of the cluster | | | | `scheduleShortId` _string_ | Specifies short Id which identifies a schedule | | MaxLength: 8
| | `schedule` _string_ | Cron expression for frequency of creating snapshots, see https://en.wikipedia.org/wiki/Cron.
The schedule is specified in UTC. | | Pattern: `^(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|([\d\*]+(\/|-)\d+)|\d+|\*) ?){5,7})$`
| @@ -606,7 +588,6 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `operatorVersion` _[OperatorVersion](#operatorversion)_ | The version of the operator which reconciles this instance | V1 | Enum: [V1 V2]
| | `cluster-id` _string_ | The cluster ID for which a Snapshot need to be taken
The cluster should be in the same namespace as this QdrantClusterSnapshot is located | | | | `creation-timestamp` _integer_ | The CreationTimestamp of the backup (expressed in Unix epoch format) | | | | `scheduleShortId` _string_ | Specifies the short Id which identifies a schedule, if any.
This field should not be set if the backup is made manually. | | MaxLength: 8
| @@ -628,7 +609,6 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `operatorVersion` _[OperatorVersion](#operatorversion)_ | The version of the operator which reconciles this instance | V1 | Enum: [V1 V2]
| | `id` _string_ | Id specifies the unique identifier of the cluster | | | | `version` _string_ | Version specifies the version of Qdrant to deploy | | | | `size` _integer_ | Size specifies the desired number of Qdrant nodes in the cluster | | Maximum: 30
Minimum: 1
|