fix: honor release-level skipSchemaValidation false by spicysharkco · Pull Request #2837 · helmfile/helmfile · GitHub
Skip to content

fix: honor release-level skipSchemaValidation false - #2837

Merged
yxxhero merged 1 commit into
helmfile:mainfrom
spicysharkco:fix/release-skip-schema-validation
Oct 21, 2026
Merged

yxxhero merged 1 commit into
helmfile:mainfrom
spicysharkco:fix/release-skip-schema-validation

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

Problem

With:

helmDefaults:
  skipSchemaValidation: true
releases:
  - name: example
    skipSchemaValidation: false

Helmfile still passes --skip-schema-validation for example. A release can set skipSchemaValidation, and an explicit false there should win over helmDefaults, as it does for wait.

Solution

The resolver checked the release value only when it was true, so false fell through to helmDefaults. The helmDefaults case now applies only when the release does not set the option, the same way appendWaitFlags treats wait. The --skip-schema-validation command-line flag still applies to every release.

The resolver builds the upgrade, template and diff flags and the chartify helm template arguments.

Test

Two rows in TestAppendSkipSchemaValidationFlagToChartifyTemplateArgs: release false with helmDefaults true (failed before: expected "", got "--skip-schema-validation"), and the command-line flag with release false (passes before and after).

go test ./pkg/state -run '^TestAppendSkipSchemaValidationFlagToChartifyTemplateArgs$' -count=1

An explicit release value of false now keeps helmDefaults from adding
--skip-schema-validation. The command-line flag still applies to every
release.

Signed-off-by: spicysharkco <321699413+spicysharkco@users.noreply.github.com>

@yxxhero yxxhero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review

Verified the precedence logic against appendWaitFlags (pkg/state/helmx.go:763) — this now matches it exactly:

  • release skipSchemaValidation: true → flag applied
  • CLI --skip-schema-validation → flag applied (also over an explicit release false, same as wait)
  • helmDefaults.skipSchemaValidation: true → applied only when the release does not set the option
  • release skipSchemaValidation: false → correctly disables the helmDefaults value ✅

Also confirmed all call sites route through the single shouldSkipSchemaValidation resolver (chartify template args, upgrade, template, and diff flag builders), so every command gets the fixed behavior — no path was missed.

Tests: the two new rows correctly cover the regression (release false + defaults true — expected "", previously got --skip-schema-validation) and the CLI-over-release precedence. LGTM.

Non-blocking observation: appendTakeOwnershipFlagsForUpgrade (pkg/state/helmx.go:828-838) has the same pattern — a release-level takeOwnership: false cannot override helmDefaults.takeOwnership: true. Might be worth a follow-up for consistency.

@yxxhero
yxxhero merged commit 54c5944 into helmfile:main Oct 21, 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