Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove spec.operatorVersion field #13

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions api/v1/qdrantcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 0 additions & 12 deletions api/v1/qdrantclusterrestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
12 changes: 0 additions & 12 deletions api/v1/qdrantclusterscheduledsnapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down
12 changes: 0 additions & 12 deletions api/v1/qdrantclustersnapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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 (
Expand Down
24 changes: 2 additions & 22 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 0 additions & 20 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,22 +299,6 @@ _Appears in:_



#### OperatorVersion

_Underlying type:_ _string_





_Appears in:_
- [QdrantClusterRestoreSpec](#qdrantclusterrestorespec)
- [QdrantClusterScheduledSnapshotSpec](#qdrantclusterscheduledsnapshotspec)
- [QdrantClusterSnapshotSpec](#qdrantclustersnapshotspec)
- [QdrantClusterSpec](#qdrantclusterspec)



#### Pause


Expand Down Expand Up @@ -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] <br /> |
| `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 | | |

Expand Down Expand 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] <br /> |
| `cluster-id` _string_ | Id specifies the unique identifier of the cluster | | |
| `scheduleShortId` _string_ | Specifies short Id which identifies a schedule | | MaxLength: 8 <br /> |
| `schedule` _string_ | Cron expression for frequency of creating snapshots, see https://en.wikipedia.org/wiki/Cron.<br />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})$` <br /> |
Expand Down Expand Up @@ -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] <br /> |
| `cluster-id` _string_ | The cluster ID for which a Snapshot need to be taken<br />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.<br />This field should not be set if the backup is made manually. | | MaxLength: 8 <br /> |
Expand All @@ -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] <br /> |
| `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 <br />Minimum: 1 <br /> |
Expand Down