-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
kops: Don't try to split --set flags on commas #16125
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
6a690bc
to
3239b22
Compare
Passing quotes in very difficult with the --set flag, because the pflag library tries to parse it using strict CSV semantics. We switch to using the StringArrayVar, which does not attempt splitting. This is a breaking change; compound flags must now be written as two flags, but I think that is clearer. Example: `--set=a,b` must now be `--set=a --set=b`
3239b22
to
b06dc2b
Compare
This would break some scenarios, like scalability tests. |
Ah, bummer. I do think We could also just do a more naive splitting on commas. We can also use the CSV splitter with LazyQuotes=true, this was proposed in spf13/pflag#371 |
I think just fixing the scalability scenario would be enough. It's not such a bad change.
|
I do think you raise a good point though, and it's possible that people are setting compound flags "in the wild" that we don't know about, so I don't particularly want to break them if we can avoid it. The fix is actually pretty easy, in #16128 - we just need to set LazyQuotes: true. It's a bit harder than it should be, but it would be very easy if pflag merged the support. My 2c: #16128 unblocks us without breaking anyone... |
#16128 was merged. |
@hakman: Closed this PR. 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. |
PR needs rebase. 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. |
Passing quotes in very difficult with the --set flag, because the
pflag library tries to parse it using strict CSV semantics. We switch
to using the StringArrayVar, which does not attempt splitting.
This is a breaking change; compound flags must now be written as two flags, but I think that is clearer.
Example:
--set=a,b
must now be--set=a --set=b