Skip to content

Operator fails to create secret in separate namespace when using ownerReferences and preparedDatabases #2910

Open
@mortenlj

Description

@mortenlj

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

  • 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, currently setting up for initial deployment
  • Type of issue? [Bug report, question, feature request, etc.]
    Bug report

Some general remarks when posting a bug report:

  • Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
  • If you feel this issue might be more related to the Spilo docker image or Patroni, consider opening issues in the respective repos.

When enabling ownerReferences, and using preparedDatabases in the cluster definition with defaultUsers: true, the operator fails to create the secrets because it attempts to attach a cross-namespace ownerReference.

The problem seems to be that this check doesn't account for the fact that when using preparedDatabases you can set secretNamespace to a value that differs from the namespace the cluster is defined in.

We realize we can create users via users instead of relying on the default users, but this still seems to be a bug that should be addressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions