Skip to content

Invalid ownerRef for secrets created with connectionStringSecretNamespace #1716

Open
@macourteau

Description

@macourteau

What did you do to encounter the bug?
Steps to reproduce the behavior:

  1. Create MongoDBCommunity resource
  2. Set connectionStringSecretNamespace for a user in that resource
  3. Observe, with kubectl events -n <namespace> --types=warning -w, that the secret gets created in that namespace after some time, but that the ownerRef field does not specify the owner object's namespace. Therefore, it is assumed to be in the same namespace, which is incorrect:
36m         Warning   OwnerRefInvalidNamespace   Secret/mongodb-admin-admin   ownerRef [mongodbcommunity.mongodb.com/v1/MongoDBCommunity, namespace: foo, name: mongodb, uid: c72c5a38-c8e8-4055-be9d-85ce39f1e359] does not exist in namespace "foo"

What did you expect?
That the ownerRef field specifies the owner's namespace.

What happened instead?
The ownerRef field did not set the owner's namespace.

Screenshots
N/A

Operator Information

  • Operator Version: 0.13.0
  • MongoDB Image used: 8.0.9

Kubernetes Cluster Information

  • Distribution: k8s
  • Version: v1.33.1
  • Image Registry location (quay, or an internal registry): quay

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