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

Match to last After keyword for parser #4383

Merged
merged 4 commits into from Nov 8, 2021

Conversation

dereknola
Copy link
Contributor

@dereknola dereknola commented Nov 2, 2021

Signed-off-by: dereknola derek.nola@suse.com

Proposed Changes

Currently the parser returns after finding the first valid keyword of After fields, now it returns the last. This enables matching on both command and subcommands for flag insertion.

Types of Changes

Bugfix

Verification

Unit test
Same S3 verification used in #4280 now works for all subcommands (save list delete prune)

Linked Issues

#4379

User-Facing Change

Values saved in "config.yaml" can now be used with the etcd-snapshot subcommands

Further Comments

@dereknola dereknola requested a review from a team as a code owner November 2, 2021 18:34
pkg/configfilearg/defaultparser.go Outdated Show resolved Hide resolved
pkg/configfilearg/parser.go Outdated Show resolved Hide resolved
pkg/configfilearg/parser.go Outdated Show resolved Hide resolved
Signed-off-by: dereknola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Copy link
Contributor

@brandond brandond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM minus one nit on the regex!

pkg/configfilearg/parser.go Outdated Show resolved Hide resolved
Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola merged commit 7bd6504 into k3s-io:master Nov 8, 2021
@dereknola dereknola deleted the k3s_etcd_config_fix branch November 11, 2021 19:17
dereknola added a commit to dereknola/k3s that referenced this pull request Nov 12, 2021
* Made parser able to skip over subcommands
* Edge case coverage, reworked regex with groups
Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Nov 12, 2021
* Made parser able to skip over subcommands
* Edge case coverage, reworked regex with groups
Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Nov 12, 2021
…th etcd-snapshot (#4475)

* Match to last After keyword for parser (#4383)
* Enabled skipping of unknown flags from config in parser
* Added new unit test, expanded existing

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Nov 12, 2021
…h etcd-snapshot (#4477)

* Match to last After keyword for parser (#4383)
* Made parser able to skip over subcommands
* Fix to allow etcd-snapshot to use config file with flags that are only used with k3s server. (#4464)

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Nov 12, 2021
* Made parser able to skip over subcommands
* Edge case coverage, reworked regex with groups
Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Nov 12, 2021
… but not defined" (#4482)

* Match to last After keyword for parser (#4383)
* Fix to allow etcd-snapshot to use config file with flags that are only used with k3s server. (#4464)

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.

None yet

3 participants