postgres-operator/pkg
Thomas Rosenstein 9ca87d9db4 Fix deletion timestamp handling for clusters with finalizers
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
2025-12-14 20:29:01 +01:00
..
apis update codegen (#2832) 2025-01-03 16:18:17 +01: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 2025-12-14 20:29:01 +01:00
controller Fix deletion timestamp handling for clusters with finalizers 2025-12-14 20:29:01 +01:00
generated update codegen (#2832) 2025-01-03 16:18:17 +01:00
spec skip db user actions when its secret failed to sync on update (#2969) 2025-11-05 16:28:37 +01:00
teams improve additional teams lookup (#2445) 2023-10-16 16:48:19 +02:00
util skip db user actions when its secret failed to sync on update (#2969) 2025-11-05 16:28:37 +01:00