Skip to content

Commit

Permalink
Use DeletionPolicy in etcd
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Jul 15, 2024
1 parent c028472 commit 11a0ae7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func Convert_v1alpha1_EtcdSpec_To_v1alpha2_EtcdSpec(in *EtcdSpec, out *v1alpha2.
})
}
// WARNING: in.UpdateStrategy requires manual conversion: does not exist in peer-type
out.TerminationPolicy = v1alpha2.TerminationPolicy(in.TerminationPolicy)
out.DeletionPolicy = v1alpha2.TerminationPolicy(in.TerminationPolicy)
return nil
}

Expand All @@ -304,7 +304,7 @@ func Convert_v1alpha2_EtcdSpec_To_v1alpha1_EtcdSpec(in *v1alpha2.EtcdSpec, out *
out.PodTemplate = in.PodTemplate
// WARNING: in.ServiceTemplates requires manual conversion: does not exist in peer-type
// WARNING: in.Halted requires manual conversion: does not exist in peer-type
out.TerminationPolicy = TerminationPolicy(in.TerminationPolicy)
out.TerminationPolicy = TerminationPolicy(in.DeletionPolicy)
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha1/zz_generated.conversion.go

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

4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/etcd_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func (e *Etcd) SetDefaults() {
if e.Spec.StorageType == "" {
e.Spec.StorageType = StorageTypeDurable
}
if e.Spec.TerminationPolicy == "" {
e.Spec.TerminationPolicy = TerminationPolicyDelete
if e.Spec.DeletionPolicy == "" {
e.Spec.DeletionPolicy = TerminationPolicyDelete
}

e.Spec.Monitor.SetDefaults()
Expand Down
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/etcd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ type EtcdSpec struct {
// +optional
Halted bool `json:"halted,omitempty"`

// TerminationPolicy controls the delete operation for database
// DeletionPolicy controls the delete operation for database
// +optional
TerminationPolicy TerminationPolicy `json:"terminationPolicy,omitempty"`
DeletionPolicy TerminationPolicy `json:"deletionPolicy,omitempty"`
}

type TLSPolicy struct {
Expand Down
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/openapi_generated.go

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

14 changes: 7 additions & 7 deletions crds/kubedb.com_etcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
deletionPolicy:
enum:
- Halt
- Delete
- WipeOut
- DoNotTerminate
type: string
halted:
type: boolean
init:
Expand Down Expand Up @@ -4064,13 +4071,6 @@ spec:
- Durable
- Ephemeral
type: string
terminationPolicy:
enum:
- Halt
- Delete
- WipeOut
- DoNotTerminate
type: string
tls:
properties:
member:
Expand Down
8 changes: 4 additions & 4 deletions openapi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -23640,6 +23640,10 @@
"description": "Database authentication secret",
"$ref": "#/definitions/dev.kubedb.apimachinery.apis.kubedb.v1alpha2.SecretReference"
},
"deletionPolicy": {
"description": "DeletionPolicy controls the delete operation for database",
"type": "string"
},
"halted": {
"description": "Indicates that the database is halted and all offshoot Kubernetes resources except PVCs are deleted.",
"type": "boolean"
Expand Down Expand Up @@ -23678,10 +23682,6 @@
"description": "StorageType can be durable (default) or ephemeral",
"type": "string"
},
"terminationPolicy": {
"description": "TerminationPolicy controls the delete operation for database",
"type": "string"
},
"tls": {
"description": "etcd cluster TLS configuration",
"$ref": "#/definitions/dev.kubedb.apimachinery.apis.kubedb.v1alpha2.TLSPolicy"
Expand Down

0 comments on commit 11a0ae7

Please sign in to comment.