-
Notifications
You must be signed in to change notification settings - Fork 924
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
[plugin] kubectl plugin env variable is not incorrect #337
Comments
I hit a similar (maybe the same?) bug in spf13/viper. Here's a related open PR: spf13/viper#398. I was able to work around the problem by switching to |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
/sig cli |
/area kubectl |
/priority P2 |
Is this still relevant with the new plugin mechanism? Please close if this is obsolete. |
This should no longer be an issue with the updated plugin mechanism. Environment variables are now passed as-is, and user-defined command flags and parameters are now passed straight through to a plugin executable. /close |
@juanvallejo: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I am experimenting with writing plugins for kubectl. One issue I found is that
KUBECTL_PLUGINS_GLOBAL_FLAG_AS_GROUP
flag is set to[]
when this flag is not set.When I try to set this env value back via
pflag.Set()
, it is considered as[]string{"[]"}
. .This causesDefaultClientConfig(flags)
to throw error. You can find my demo code here: https://github.com/tamalsaha/kubectl-plugin-demo/blob/master/root.go#L79The real problem seems to be that
String()
andSet(val string)
methods ofstringArrayValue
in pflag library does not properly handle "empty" value for flags.The text was updated successfully, but these errors were encountered: