zalando / zalando/postgres-operator
When using finalizers, delete protection via annotation is ignored
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
- Which image of the operator are you using? e.g. ghcr.io/zalando/postgres-operator:v1.13.0
ghcr.io/zalando/postgres-operator:v1.14.0 - Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s | GCP ... | Bare Metal K8s]
GCP - Are you running Postgres Operator in production? [yes | no]
Not yet - Type of issue? [Bug report, question, feature request, etc.]
Bug report
When using finalizers, the operator deletes all resources before the EventDelete event is received.
The delete protection check occurs when the EventDelete event is added to the queue, but by then all the resources have been deleted.
When the operator notices the DeleteTimestamp is set here, it proceeds to delete the cluster right away.
It might be better at that point to simply queue an EventDelete event to handle the deletion the normal way (assuming I've understood the internal event system correctly).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/controller/postgresql.go at the DeleteTimestamp handling around line 334, then trace how EventDelete is queued and where the annotation-based delete protection is checked. Confirm the finalizer path and event flow with the existing controller tests, if present. Done means delete protection is honored before resources are removed when finalizers are used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100