Closed Desuuuu closed 2 years ago
Hey @Desuuuu,
Thanks for the issue.
Similar issues might come up if the secret isn't labeled atlas.mongodb.com/type=credentials
, like this:
kubectl label secret slack-token atlas.mongodb.com/type=credentials -n mongodb-atlas-system
Let me know if this helps 😌
It does not help. As you can see in the two examples I provided, my secret is already labeled.
The problem is pretty obvious when you look at the piece of code I linked to above: the condition is inverted.
Ah, yeah, now I see it, thank you! Will be fixed in the Monday release 👌
This fixed the case where a different namespace is specified, but not the case where no namespace is specified.
The GetObject
method, which ultimately determines which namespace is used, still returns an invalid key (empty namespace) when rn.Namespace
is empty.
What did you do to encounter the bug?
What did you expect? The reference should use the provided namespace, or the project namespace if unspecified.
What happened instead? In both cases, the operator produces an error similar to this:
Operator Information
Additional context This condition is causing the issue: https://github.com/mongodb/mongodb-atlas-kubernetes/blob/4e6130ec419246b5a7a0491b9e1cbfcd48403e90/pkg/api/v1/common/common.go#L49-L52
Different namespace:
Same namespace: