postgres-operator/pkg
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
..
apis Add topologySpreadConstraints configuration to pod spec. (#2530) 2026-05-29 17:07:47 +02:00
apiserver Add operator deployment readiness probe (#1874) 2023-01-05 18:29:47 +01:00
cluster Fix deletion timestamp handling for clusters with finalizers (#3015) 2026-06-01 09:18:20 +02:00
controller Fix deletion timestamp handling for clusters with finalizers (#3015) 2026-06-01 09:18:20 +02:00
generated Regenerate code for 2026 header (#3029) 2026-01-09 15:38:16 +01:00
spec Generate CRD for postgresteam resource (#3004) 2026-01-10 19:39:08 +01:00
teams Generate CRD for postgresteam resource (#3004) 2026-01-10 19:39:08 +01:00
util build multi-arch pooler image (#3077) 2026-04-28 13:34:36 +02:00