Skip to content

Cannot create connectionStringSecret in different namespace #343

@thombohlk

Description

@thombohlk

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

  1. Create a MongoDBCommunity resource in namespace X
  2. Add a user with a connectionStringSecret in namespace Y
      users:
        - name: test
          db: test
          passwordSecretRef:
            name: mongo-password
          connectionStringSecretNamespace: some_namespace
          roles:
            - name: dbOwner
              db: test
    
  3. Notice the secret being created and deleted every few seconds

What did you expect?
For a stable secret to be present in namespace Y containing the connection string.

What happened instead?
The secret is created and immediately removed again. This is caused by the ownerReference of the secret, which points to the MongoDBCommunity resource in namespace X. This is not allowed, and the secret is therefor garbage collected link.

Operator Information

  • Operator Version: 0.13.0
  • MongoDB Image used: 8.0.4

Kubernetes Cluster Information

  • Distribution: RKE2
  • Version: v1.32.5+rke2r1
  • Image Registry location: 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