-
Notifications
You must be signed in to change notification settings - Fork 30
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
Adding Finalizer on Secret #279
Conversation
erwin-kok
commented
Sep 1, 2024
- Added Finalizer on CredentialsRef Secret
- Added test to test the secret Finalizer
- The "ProxmoxClusterTemplate" was probably added manually, this lacked some files and an item in PROJECT. Added this properly using kubebuilder.
- A bit of refactoring. i.s.o SetupWithManager, use AddProxmoxClusterReconciler/AddProxmoxMachineReconciler
- Tested manually and using "make test"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Credentials Secret is meant to be a global secret that is used by multiple clusters.
Please change the logic.
Thanks for reviewing Mohamed (@mcbenjemaa)! Can you clarify why the secret should be re-used over clusters? So lets say I have an prod and a development cluster, they can share their secrets? A development cluster (accidentally using the wrong secret) can deploy something in prod? Or perhaps I misunderstood something. |
That's not the case. If the user chooses the wrong secret and creates a cluster in a different proxmox cluster, that's the user's fault, and we can't do anything about it. (cause we don't know which is correct and which is wrong) |
Thanks for clarifying. I assumed that the approach would be to deploy a different cluster to a different namespace (in the management cluster). So namespace"prod" manages the "prod" cluster, and namespace "dev" manages the "dev" cluster, etc. And every namespace has its own secrets, not shared over namespaces. In this way, a dev namespace (cluster) should not access prod secrets. If you have two prod clusters, prod1 and prod2, they both have their own (potentially the same) secrets. Of course, if you deploy prod secrets in a dev cluster then it uses that... |
You need to solve the conflict. |
I think we are close to merging this: @erwin-kok please fix the linter issues, once that's done @mcbenjemaa can do his final review. |
So, there were two linting issues, both not related to my code (but I solved them anyway):
because the if-statement ends with a return, the else branch can be "unblocked":
|
Quality Gate passedIssues Measures |