zalando / zalando/postgres-operator

Failure to create when an ownerReference is set on postgresql cr

Open
#2,768 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? ghcr.io/zalando/postgres-operator:v1.13.0
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? OpenShift 4.15
  • Are you running Postgres Operator in production? yes
  • Type of issue? Bug report

I've tried creating a postgresql resource with an ownerReference set to another resource. This resulted in a failure to create the postgres instance with the following error message:

time="2024-09-27T12:00:14Z" level=info msg="creating a new Postgres cluster" cluster-name=my-namespace/my-postgres pkg=controller worker=5
time="2024-09-27T12:00:14Z" level=warning msg="cluster created failed: could not create master service: services \"my-postgres\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil>" cluster-name=my-namespace/my-postgres pkg=cluster worker=5

When I don't set an ownerReference on the postgresql resource the cluster creates without issue. Looking at a successfully created cluster I cannot see any ownerReferences set on the svc/my-postgres. The new owner references feature is not enabled in our environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing creation of a PostgreSQL resource with an ownerReference on OpenShift 4.15 and trace the master service creation path; done means the cluster is created successfully with that ownerReference while existing creation without one continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.