-
Notifications
You must be signed in to change notification settings - Fork 520
feat: customize connection string secret annotations #1582
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
base: master
Are you sure you want to change the base?
feat: customize connection string secret annotations #1582
Conversation
2ece40f
to
c7c21e5
Compare
Thank you for your contribution @limwa , enabling the tests for this and will review to get it to a merge-able state. |
Hey @mircea-cosbuc! Is there any thing I need to do or should I just wait? Thanks! |
Hi. Yes, I'll add the tests (and thank you for the example)! Right now, I'm a bit busy, but I'll pick this up as soon as possible. |
Hi thanks @limwa for this PR, was exaclty what I need and btw, it works smooth. I build and push to a public registry an image non official from this PR code. I want to let you all know in case someone else came to this before mongodb guys and the pr owner figure out the remaining requirements. |
441396d
to
0d6e1f2
Compare
Hey @nammn, regarding the tests, I've added a test that tests for the presence of the annotations in the generated secret. If there's anything else I can help with, please let me know! Thank you for your time. |
This PR is being marked stale because it has been open for 60 days with no activity. Please update the PR or ask for a fresh review. |
@mircea-cosbuc @lsierant @slaskawi @nammn @Julien-Ben @MaciejKaras @lucian-tosa @fealebenpae can this PR get a review please? Sorry for the notification, but the stale-bot said I should ask for a fresh review |
e71a8fb
to
4075d85
Compare
Summary:
Closes #1522.
In this PR, I've added the ability to add custom annotations to the generated connection string secrets.
This is useful to handle more deployment scenarios, in particular, the scenarios where the operator is not deployed cluster-wide, but to a specific namespace. In these scenarios the
connectionStringSecretNamespace
property becomes useless, because, as stated in the Kubernetes docs, cross-namespace owner references are disallowed, thus allowing for the secrets to be immediately garbage-collected, as stated in #1578. For the owner references to be valid, the secrets need to be generated in the namespace of the MDBC resource. However, if the user needs the secrets to be present in other namespaces, they can use reflector, for instance, which allows for the secrets to be copied to other namespaces. The problem is that reflector and other similar controllers require the source secrets to be annotated with specific properties.As such, I've implemented a
connectionStringSecretAnnotations
property which allows mongodb-kubernetes-operator users to specify per-user connection string secret annotations.I've done it in this way because I'm not very experienced with Go and this felt like the simplest way to do it. I could've also refactored all of the connection string secret to be grouped under a
connectionStringSecret
object, but this would break backwards compatibility.All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if such).