postgres-operator/pkg/cluster
thoro f988e4cf0e
Fix deletion timestamp handling for clusters with finalizers (#3015)
When a Postgres cluster has a finalizer, deleting it sets a DeletionTimestamp
but doesn't remove the object until the finalizer is cleared. The operator
was not properly handling these DeletionTimestamp changes:

1. postgresqlUpdate() was filtering out events where only DeletionTimestamp
   changed (it only checked Spec and Annotations), causing the delete to
   never be processed.

2. EventUpdate case in processEvent() didn't check for DeletionTimestamp,
   so even if the event reached the processor, it would run Update() instead
   of Delete().

3. removeFinalizer() used a cached object with stale resourceVersion,
   causing "object has been modified" errors.

Fixes:
- Add explicit DeletionTimestamp check in postgresqlUpdate() to queue the event
- Add DeletionTimestamp check in EventUpdate to call Delete() when set
- Fetch latest object from API before removing finalizer to avoid conflicts

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-01 09:18:20 +02:00
..
cluster.go Fix deletion timestamp handling for clusters with finalizers (#3015) 2026-06-01 09:18:20 +02:00
cluster_test.go Remove references to registry.opensource.zalan.do (#3092) 2026-05-08 09:16:10 +02:00
connection_pooler.go Volume mount length of pooler users (#3093) 2026-05-08 17:25:59 +02:00
connection_pooler_new_test.go Connection pooler for replica (#1127) 2020-11-13 14:52:21 +01:00
connection_pooler_test.go build multi-arch pooler image (#3077) 2026-04-28 13:34:36 +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 Add topologySpreadConstraints configuration to pod spec. (#2530) 2026-05-29 17:07:47 +02:00
k8sres_test.go Add topologySpreadConstraints configuration to pod spec. (#2530) 2026-05-29 17:07:47 +02:00
majorversionupgrade.go Remove hardcoded VersionMap from majorversionupgrade (#3043) 2026-03-02 11:13:10 +01:00
pod.go Fix rolling update deadlock when pods are stuck in non-running state (#3051) 2026-04-28 12:08:34 +02:00
pod_test.go Fix rolling update deadlock when pods are stuck in non-running state (#3051) 2026-04-28 12:08:34 +02:00
resources.go bump dependencies and reflect linter suggestions (#2963) 2025-10-16 10:23:36 +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 Fix rolling update deadlock when pods are stuck in non-running state (#3051) 2026-04-28 12:08:34 +02:00
sync_test.go do not reset secrets of standby clusters (#3044) 2026-02-26 17:27:47 +01:00
types.go Critical operation PDB (#2830) 2025-01-29 12:41:08 +01:00
util.go feature toggle for using maintenance windows (#3074) 2026-04-16 17:13:18 +02:00
util_test.go feature toggle for using maintenance windows (#3074) 2026-04-16 17:13:18 +02:00
volumes.go fix: correct 'occured' typo in error messages (#3094) 2026-05-11 11:16:37 +02:00
volumes_test.go Add support for EBS CSI Driver (#2677) 2024-12-19 12:32:09 +01:00