Skip to content

Commit 359a658

Browse files
authored
Add QdrantClusterRestore .spec.destination.create field (#147)
It makes new cluster creation explicit, preventing users to create accidentally a cluster in case of typo in the referred cluster name.
1 parent 38116a6 commit 359a658

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

api/v1/qdrantclusterrestore_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ type RestoreDestination struct {
2828
Name string `json:"name"`
2929
// Namespace of the destination cluster
3030
Namespace string `json:"namespace"`
31+
// Create when set to true indicates that
32+
// a new cluster with the specified name should be created.
33+
// Otherwise, if set to false, the existing cluster is going to be restored
34+
// to the specified state.
35+
// +optional
36+
Create bool `json:"create"`
3137
}
3238

3339
type RestorePhase string

charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusterrestores.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ spec:
5555
description: Destination defines the destination cluster where the
5656
source data will end up
5757
properties:
58+
create:
59+
description: |-
60+
Create when set to true indicates that
61+
a new cluster with the specified name should be created.
62+
Otherwise, if set to false, the existing cluster is going to be restored
63+
to the specified state.
64+
type: boolean
5865
name:
5966
description: Name of the destination cluster
6067
type: string

crds/qdrant.io_qdrantclusterrestores.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ spec:
5454
description: Destination defines the destination cluster where the
5555
source data will end up
5656
properties:
57+
create:
58+
description: |-
59+
Create when set to true indicates that
60+
a new cluster with the specified name should be created.
61+
Otherwise, if set to false, the existing cluster is going to be restored
62+
to the specified state.
63+
type: boolean
5764
name:
5865
description: Name of the destination cluster
5966
type: string

docs/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ _Appears in:_
11971197
| --- | --- | --- | --- |
11981198
| `name` _string_ | Name of the destination cluster | | |
11991199
| `namespace` _string_ | Namespace of the destination cluster | | |
1200+
| `create` _boolean_ | Create when set to true indicates that<br />a new cluster with the specified name should be created.<br />Otherwise, if set to false, the existing cluster is going to be restored<br />to the specified state. | | |
12001201

12011202

12021203
#### RestorePhase

0 commit comments

Comments
 (0)