postgres-operator/pkg/cluster
adshin21 bbc3eab7e0
Skip owner references on user secrets when secret deletion is disabled (#3165)
* Skip owner references on user secrets when secret deletion is disabled

Kubernetes garbage-collects owner-referenced secrets as soon as the
owning Postgresql resource is deleted, regardless of the operator's
own EnableSecretsDeletion check in Delete() (which only guards the
operator's explicit deleteSecrets() call, not GC). This made
enable_secrets_deletion=false ineffective whenever
enable_owner_references was also enabled, since GC removed the
credential secrets anyway.

Now the generated secrets are not removed when
enable_owner_references: true, enable_secrets_deletion: false.

* Document skip-owner-refs on user secrets when deletion disabled

- refresh inline comment in generateSingleUserSecret
- extend enable_owner_references / enable_secrets_deletion docs in
  operator_parameters.md to describe the interaction
- clarify in operator_parameters.md that the protection takes effect
  on the cluster's next sync after the setting is applied
- add third exception in administrator.md "Owner References and Finalizers"
- add TestGenerateSingleUserSecret_OwnerReferences covering all four
  flag combinations plus the cross-namespace cases

---------

Co-authored-by: Serdar Dalgıç <sd@serdardalgic.org>
2026-08-11 17:22:39 +02:00
..
cluster.go remove gp3 migration flow (#3142) 2026-07-27 14:02:44 +02:00
cluster_test.go prepare bugfix release (#3147) 2026-07-29 10:51:00 +02:00
connection_pooler.go switch to metav1.Duration for timeout options (#3121) 2026-06-29 10:32:24 +02:00
connection_pooler_new_test.go Connection pooler for replica (#1127) 2020-11-13 14:52:21 +01:00
connection_pooler_test.go feat: implement service type NodePort (#2986) 2026-06-12 10:02:26 +02:00
database.go stop retention user cleanup early again when DB connection attempt fails (#2999) 2025-12-10 10:01:07 +01:00
exec.go fix golangci-lint issues (#2715) 2024-08-14 12:54:44 +02:00
filesystems.go reflect change in github url (#496) 2019-02-25 11:26:55 +01:00
k8sres.go Skip owner references on user secrets when secret deletion is disabled (#3165) 2026-08-11 17:22:39 +02:00
k8sres_test.go Skip owner references on user secrets when secret deletion is disabled (#3165) 2026-08-11 17:22:39 +02:00
majorversionupgrade.go Update to Go 1.26.4, build runners and go.mod depedencies (#3108) 2026-06-23 13:35:53 +02:00
pod.go switch to metav1.Duration for timeout options (#3121) 2026-06-29 10:32:24 +02:00
pod_test.go switch to metav1.Duration for timeout options (#3121) 2026-06-29 10:32:24 +02:00
resources.go switch to metav1.Duration for timeout options (#3121) 2026-06-29 10:32:24 +02:00
streams.go do not remove publications of slot defined in manifest (#2868) 2025-02-26 17:31:37 +01:00
streams_test.go fix flaky comparison unit test of retruned errors (#2822) 2024-12-19 17:35:01 +01:00
sync.go remove gp3 migration flow (#3142) 2026-07-27 14:02:44 +02:00
sync_test.go switch to metav1.Duration for timeout options (#3121) 2026-06-29 10:32:24 +02:00
types.go Critical operation PDB (#2830) 2025-01-29 12:41:08 +01:00
util.go document changed configmap default (#3116) 2026-07-02 14:04:57 +02:00
util_test.go feat (operator): add support for IRSA (aws resources access) (#3128) 2026-07-15 18:19:10 +02:00
volumes.go change volume specs to int32 and define max iops and throughput values (#3139) 2026-07-27 16:32:22 +02:00
volumes_test.go change volume specs to int32 and define max iops and throughput values (#3139) 2026-07-27 16:32:22 +02:00