-
Notifications
You must be signed in to change notification settings - Fork 478
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
Fix redefine flag #2992
Fix redefine flag #2992
Conversation
Signed-off-by: Filinto Duran <[email protected]>
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.
Although this PR LGTM, I was not aware of this code and this behavior. It does seem odd that we're defining CLI flags in components-contrib. This seems anti-pattern?
It does seem strange maybe to ease tests but don't know the original use case |
Do we really register it in the CLI? |
Looks like it is getting registered. Running
I think this needs to change. We should allow setting the kubeconfig file using the metadata for each component. @filintod can you change that please? |
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.
Let's refactor this to avoid adding CLI flags to daprd
I can follow as how it is done in dapr https://github.com/dapr/dapr/blob/master/utils/utils.go#L50 with a custom kubeconfig env var wdty? |
@filintod that method looks like is being used by Dapr control plane services only (operator, injector, sentry), and not by daprd. I would prefer the Kubeconfig path to be a metadata option in all Kubernetes components. This is the pattern we use to configure all components. |
…nto filinto/redefine-kubeconfig-issue
Make CLI flag deprecated Add support for env var Signed-off-by: ItalyPaleAle <[email protected]>
Signed-off-by: ItalyPaleAle <[email protected]>
thanks, sorry I forgot about this. |
No worries! It became a bit more of a pressure because of dapr/dapr#6766 Do the changes look good to you? Mind doing a quick review? I plan on doing the 2nd part, which is allowing setting kubeconfig path in components' metadata, in a separate PR. |
Related to dapr#2992 Passing a kubeconfig path should happen via metadata and not CLI flags, which are deprecated. Also adds a "defaultNamespace" optional metadata to the Kubernetes secret store. Signed-off-by: ItalyPaleAle <[email protected]>
See #3060 for part 2 |
Description
This PR add something similar to kubernetes-sigs/controller-runtime#1999 to avoid redefined kubeconfig flag issues when using this library plus others that might already have kubeconfig as a flag.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #2993
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: