Skip to content
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

Handle multiple arguments with StringSlice flags #7380

Merged
merged 4 commits into from
May 2, 2023

Conversation

dereknola
Copy link
Member

Proposed Changes

  • Adds a helper function SplitSliceString which allows SliceString flags like --tls-san to accept not only repeated arguments (e.g. --tls-san=foo --tls-san=bar) but also multliple comma separated args (e.g. --tls-san="foo,bar")

Types of Changes

CLI

Verification

See linked issue.

Testing

2 New unit tests

Linked Issues

#7365

User-Facing Change


Further Comments

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola requested a review from a team as a code owner April 28, 2023 17:49
pkg/util/client.go Outdated Show resolved Hide resolved
Signed-off-by: Derek Nola <derek.nola@suse.com>
pkg/util/client.go Outdated Show resolved Hide resolved
Signed-off-by: Derek Nola <derek.nola@suse.com>
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.14 🎉

Comparison is base (9539147) 19.31% compared to head (4dc03ac) 19.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7380      +/-   ##
==========================================
+ Coverage   19.31%   19.45%   +0.14%     
==========================================
  Files          81       81              
  Lines        5458     5448      -10     
==========================================
+ Hits         1054     1060       +6     
+ Misses       4182     4168      -14     
+ Partials      222      220       -2     
Flag Coverage Δ
unittests 19.45% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/util/client.go 25.00% <100.00%> (+25.00%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dereknola dereknola merged commit d5f5603 into k3s-io:master May 2, 2023
@dereknola dereknola deleted the sans_check branch May 2, 2023 18:44
dereknola added a commit to dereknola/k3s that referenced this pull request May 2, 2023
* Add helper function for multiple arguments in stringslice

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request May 2, 2023
* Add helper function for multiple arguments in stringslice

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request May 2, 2023
* Add helper function for multiple arguments in stringslice

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request May 2, 2023
* Handle multiple arguments with StringSlice flags (#7380)

* Add helper function for multiple arguments in stringslice

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Enable FindString to search dotD config files (#7323)

* Enable FindString to search dotD config files
* Address multiple arg cases

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request May 2, 2023
* Handle multiple arguments with StringSlice flags (#7380)

* Add helper function for multiple arguments in stringslice
* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Enable FindString to search dotD config files (#7323)

* Enable FindString to search dotD config files
* Address multiple arg cases

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request May 2, 2023
* Handle multiple arguments with StringSlice flags (#7380)
* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Enable FindString to search dotD config files (#7323)
* Address multiple arg cases

Signed-off-by: Derek Nola <derek.nola@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants