fix: trim spaces in feature flag lists - #10272
Open
Jay2006sawant wants to merge 3 commits into
Open
Conversation
Signed-off-by: Jay2006sawant <jay242902@gmail.com>
👷 Deploy request for velero pending review.Visit the deploys page to approve it
|
Signed-off-by: Jay2006sawant <jay242902@gmail.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Jay2006sawant <jay242902@gmail.com>
Jay2006sawant
force-pushed
the
fix/trim-comma-separated-features
branch
from
August 15, 2026 11:50
a575d9c to
547611e
Compare
ywk253100
reviewed
Aug 17, 2026
| } | ||
|
|
||
| return strings.Split(features, ",") | ||
| parts := strings.Split(features, ",") |
Contributor
There was a problem hiding this comment.
Could you put the split and tram space logic in a seperate util function so that it can be reused?
Please also refactor with the util fucntion for the changes in #10259
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to Velero!
Please add a summary of your change
Comma-separated feature lists with spaces after commas did not enable the intended features. For example
EnableCSI, EnableAPIGroupVersionsstored a leading space, sofeatures.IsEnabled("EnableAPIGroupVersions")returned false.Trim whitespace (and drop empty entries) when parsing feature lists from the CLI flag, client config, install options, and the feature flag helpers.
Does your change fix a particular issue?
No existing GitHub issue. Found while reviewing feature-flag parsing on current main.
Please indicate you've done the following:
site/content/docs/main(not required).Test plan
go test ./pkg/features/go test ./pkg/client/ -run TestVeleroConfiggo test ./pkg/cmd/util/flag/ -run StringArraygo test ./pkg/cmd/cli/install/ -run TestSplitAndTrimCSV