Skip to content

fix: align state-values-set empty input and key validation - #2864

Merged
yxxhero merged 1 commit into
helmfile:mainfrom
spicysharkco:fix/state-values-set-assignment-validation
Oct 31, 2026
Merged

yxxhero merged 1 commit into
helmfile:mainfrom
spicysharkco:fix/state-values-set-assignment-validation

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

Follow-up to the two cases raised in #2855.

  • Ignore an entirely empty --state-values-set flag value, including between repeated flags.
  • Reject keys starting with the ASCII whitespace characters already rejected by --state-values-set-string, instead of creating a key such as " b" from a=1, b=2.

This chooses rejection rather than trimming, consistent with the existing string flag's handling of space-led keys. Spaces in values are preserved. Empty segments caused by leading, trailing or repeated commas remain errors.

The existing parser table covers both reported cases and keeps the escaping and type-conversion checks. The CLI documentation describes empty flags and space-led keys.

Validation:

  • Empty-flag and leading-whitespace regressions fail on unchanged upstream and pass with the fix. Reverting either condition is caught by its regression cases.
  • go test -race -p=1 ./pkg/config -count=1, make check PKGS=./pkg/config, and golangci-lint v2.15.0 on ./pkg/config/... pass.
  • Formatting, go fix -diff ./pkg/config and diff checks are clean. A before/after probe checks 46 typed/string input forms; only the eight intended typed-input cases change.

The full Helm-version and integration test matrices were not run.

@yxxhero
yxxhero force-pushed the fix/state-values-set-assignment-validation branch from 9a55fcd to 0ef3a53 Compare October 31, 2026 01:23
@yxxhero
yxxhero merged commit 3f0cc01 into helmfile:main Oct 31, 2026
17 checks passed
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.

2 participants