Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to create when an ownerReference is set on postgresql cr #2768

Open
bo0ts opened this issue Sep 27, 2024 · 1 comment
Open

Failure to create when an ownerReference is set on postgresql cr #2768

bo0ts opened this issue Sep 27, 2024 · 1 comment

Comments

@bo0ts
Copy link

bo0ts commented Sep 27, 2024

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.

@bo0ts
Copy link
Author

bo0ts commented Sep 27, 2024

Looking at https://github.com/zalando/postgres-operator/blob/master/pkg/cluster/k8sres.go#L2524 I understand why the error is happening: the operator tries to "forward" the ownerReference set on the CR, but I don't understand why it is doing that at all. The comment for the function also talks about the dependency on the CRD or StatefulSEt, but I assume it means the CR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant