Skip to content

Commit 473a203

Browse files
authored
adding finalizer option in all manifests and rework its docs (#2521)
1 parent 8f31399 commit 473a203

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

docs/reference/operator_parameters.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,16 @@ configuration they are grouped under the `kubernetes` key.
333333
will not add the `spilo-role=master` selector to the PDB.
334334

335335
* **enable_finalizers**
336-
By default, a deletion of the Postgresql resource will trigger a cleanup of
337-
all child resources. However, if the database cluster is in a broken state
338-
(e.g. failed initialization) and the operator cannot fully sync it, there can
339-
be leftovers from a DELETE event. By enabling finalizers the Operator will
340-
ensure all managed resources are deleted prior to the Postgresql resource.
336+
By default, a deletion of the Postgresql resource will trigger an event
337+
that leads to a cleanup of all child resources. However, if the database
338+
cluster is in a broken state (e.g. failed initialization) and the operator
339+
cannot fully sync it, there can be leftovers. By enabling finalizers the
340+
operator will ensure all managed resources are deleted prior to the
341+
Postgresql resource. There is a trade-off though: The deletion is only
342+
performed at the next cluster SYNC cycle when finding a `deletionTimestamp`
343+
in the metadata and not immediately after issueing a delete command. The
344+
final removal of the custom resource will add a DELETE event to the worker
345+
queue but the child resources are already gone at this point.
341346
The default is `false`.
342347

343348
* **enable_pod_disruption_budget**

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.19
44

55
require (
66
github.com/aws/aws-sdk-go v1.42.18
7-
github.com/evanphx/json-patch v4.12.0+incompatible
87
github.com/golang/mock v1.6.0
98
github.com/lib/pq v1.10.4
109
github.com/motomux/pretty v0.0.0-20161209205251-b2aad2c9a95d
@@ -27,6 +26,7 @@ require (
2726
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2827
github.com/davecgh/go-spew v1.1.1 // indirect
2928
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
29+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
3030
github.com/go-logr/logr v1.2.3 // indirect
3131
github.com/go-openapi/jsonpointer v0.19.5 // indirect
3232
github.com/go-openapi/jsonreference v0.19.5 // indirect

manifests/configmap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ data:
3939
# enable_admin_role_for_users: "true"
4040
# enable_crd_registration: "true"
4141
# enable_cross_namespace_secret: "false"
42+
enable_finalizers: "false"
4243
# enable_database_access: "true"
4344
enable_ebs_gp3_migration: "false"
4445
# enable_ebs_gp3_migration_max_size: "1000"

manifests/operatorconfiguration.crd.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ spec:
203203
enable_cross_namespace_secret:
204204
type: boolean
205205
default: false
206+
enable_finalizers:
207+
type: boolean
208+
default: false
206209
enable_init_containers:
207210
type: boolean
208211
default: true

manifests/postgresql-operator-default-configuration.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ configuration:
5757
# - deployment-time
5858
# - downscaler/*
5959
# enable_cross_namespace_secret: "false"
60+
enable_finalizers: false
6061
enable_init_containers: true
6162
enable_pod_antiaffinity: false
6263
enable_pod_disruption_budget: true

pkg/apis/acid.zalan.do/v1/crds.go

+3
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,9 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{
13051305
"enable_cross_namespace_secret": {
13061306
Type: "boolean",
13071307
},
1308+
"enable_finalizers": {
1309+
Type: "boolean",
1310+
},
13081311
"enable_init_containers": {
13091312
Type: "boolean",
13101313
},

0 commit comments

Comments
 (0)