Skip to content

fix: trim spaces in feature flag lists - #10272

Open
Jay2006sawant wants to merge 3 commits into
velero-io:mainfrom
Jay2006sawant:fix/trim-comma-separated-features
Open

fix: trim spaces in feature flag lists#10272
Jay2006sawant wants to merge 3 commits into
velero-io:mainfrom
Jay2006sawant:fix/trim-comma-separated-features

Conversation

@Jay2006sawant

Copy link
Copy Markdown
Contributor

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, EnableAPIGroupVersions stored a leading space, so features.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:

  • Accepted the DCO.
  • Created a changelog file.
  • Updated docs in site/content/docs/main (not required).

Test plan

  • go test ./pkg/features/
  • go test ./pkg/client/ -run TestVeleroConfig
  • go test ./pkg/cmd/util/flag/ -run StringArray
  • go test ./pkg/cmd/cli/install/ -run TestSplitAndTrimCSV

Signed-off-by: Jay2006sawant <jay242902@gmail.com>
@Jay2006sawant
Jay2006sawant requested a review from a team as a code owner August 14, 2026 09:35
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

👷 Deploy request for velero pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 547611e

Signed-off-by: Jay2006sawant <jay242902@gmail.com>
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/features/feature_flags.go 81.81% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Jay2006sawant <jay242902@gmail.com>
@Jay2006sawant
Jay2006sawant force-pushed the fix/trim-comma-separated-features branch from a575d9c to 547611e Compare August 15, 2026 11:50
Comment thread pkg/client/config.go
}

return strings.Split(features, ",")
parts := strings.Split(features, ",")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants