Skip to content

fix: skip chartify for build command jsonPatches - #2212

Merged
yxxhero merged 1 commit into
helmfile:mainfrom
sstarcher:feature/shane-build
Oct 4, 2025
Merged

yxxhero merged 1 commit into
helmfile:mainfrom
sstarcher:feature/shane-build

Conversation

@sstarcher

Copy link
Copy Markdown
Contributor

The build command is intended to be a read-only inspection command that outputs the helmfile state. However, when releases use jsonPatches, strategicMergePatches, or transformers, the chart preparation step triggers chartify, which runs helm template and requires dependencies to be built.

This causes two issues:

  1. helm template is executed unnecessarily for a simple state inspection
  2. Missing chart dependencies cause errors even with SkipDeps enabled

This change modifies PrepareCharts to filter out releases that require chartify when the command is "build". These releases are excluded from chart preparation, preventing helm template from being invoked.

The state output will still include these releases, but their charts won't be processed during the build operation.

The build command is intended to be a read-only inspection command that
outputs the helmfile state. However, when releases use jsonPatches,
strategicMergePatches, or transformers, the chart preparation step
triggers chartify, which runs helm template and requires dependencies to
be built.

This causes two issues:
1. helm template is executed unnecessarily for a simple state inspection
2. Missing chart dependencies cause errors even with SkipDeps enabled

This change modifies PrepareCharts to filter out releases that require
chartify when the command is "build". These releases are excluded from
chart preparation, preventing helm template from being invoked.

The state output will still include these releases, but their charts
won't be processed during the build operation.

Signed-off-by: Shane Starcher <[email protected]>
@sstarcher
sstarcher force-pushed the feature/shane-build branch from aff4d4b to 4a2cfb9 Compare October 4, 2025 19:45
@yxxhero
yxxhero merged commit 6673eba into helmfile:main Oct 4, 2025
yxxhero added a commit to yxxhero/helmfile that referenced this pull request Jul 12, 2026
…pace (helmfile#1859)

The build command is read-only and runs with SkipRepos: true, meaning
repositories are not synced. However, releases with dependencies or
forceNamespace trigger chartify (PrepareChartify in helmx.go), which
runs helm fetch/pull/template and requires repos — causing
"repo <repo> not found" errors.

PR helmfile#2212 partially addressed this by filtering releases with jsonPatches,
strategicMergePatches, and transformers. This change extends the filter
to also cover dependencies and forceNamespace, completing the fix for
issue helmfile#1859.

The filter is refactored into triggersChartifyRemote() which mirrors all
conditions in PrepareChartify that set shouldRun=true and require network
access. The local-directory case (NeedsChartifyForLocalDir) is excluded
as it operates on local paths without needing remote repos.

Signed-off-by: yxxhero <[email protected]>
Signed-off-by: yxxhero <[email protected]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants