Helm's `dependency build` on the parent chart fetches each file:// subchart
and packages it as .tgz, but does NOT recursively build the subchart's own
dependencies first. For envelope charts whose subcharts declare their own
local file:// dependencies, the resulting .tgz lacks the nested subchart's
resources. chartify's `helm template` then silently drops those resources,
and strategicMergePatches/jsonPatches targeting them fail with
"no resource matches".
Fix: add `preBuildTransitiveSubchartDeps`, called from processChartification
before chartify runs (gated on !skipDeps). It walks the transitive file://
dependency tree depth-first and runs `helm dependency build` bottom-up on each
subchart source directory, so each subchart's deps are pre-built before the
parent packages them. The function is best-effort: errors are logged at debug
level and do not abort the operation, matching helmfile's existing behavior
of tolerating already-built deps.
Verified with a reproduction case that fails before the fix
(`Error: no resource matches strategic merge patch ".../nested-sm.[noNs]"`)
and passes after it.
Resolves#851
Signed-off-by: yxxhero <aiopsclub@163.com>
Add support for trackMode: helm-legacy to use Helm v4's --wait=legacy flag,
which maintains compatibility with Helm v3's wait behavior during migration.
Helm v4 changed the default --wait behavior from polling to a watcher-based
approach. This can cause issues with charts that have broken livenessProbe
configurations without startupProbe. The --wait=legacy flag preserves the
Helm v3 polling behavior for smoother migration.
Changes:
- Add TrackModeHelmLegacy constant in pkg/kubedog/options.go
- Use kubedog.TrackMode constants instead of raw strings in helmx.go
- Enhance appendWaitFlags to use --wait=legacy for Helm v4 when trackMode
is helm-legacy
- Add nil check for logger before logging warning
- Add version check with warning when helm-legacy is used with Helm v3
- Update validation in pkg/config to accept helm-legacy track mode
- Update command-line flags in cmd/apply.go and cmd/sync.go
- Add comprehensive documentation in docs/advanced-features.md
- Add thorough test coverage including warning message verification
Behavior:
- Helm v4 + helm-legacy: Uses --wait=legacy
- Helm v3 + helm-legacy: Falls back to --wait with warning
- Helm v4 + helm: Uses --wait (watcher mode)
- Any + kubedog: Skips --wait flag
Fixes#2464
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Copilot <copilot@github.com>
Allow configuring the lockfile in the state. This makes it possible for
example maintain a lock per environment.
Signed-off-by: Lassi Pölönen <lassi.polonen@iki.fi>
Signed-off-by: Lassi Pölönen <lassi.polonen@iki.fi>
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
This adds OCI registry support for adhoc dependencies.
The users can now add their OCI hosted charts as dependencies to helm releases:
* Bump chartify version to v0.10.0
* Add an example helmfile to advanced usage section
Please see the updated `advanced-features.md` for more details.
This is often used for adding common labels and annotations to any resources rendered from a Helm chart.
This is the GA version of the helm-x integration #673 developed last year.
You get all the following benefits without an extra helm plugin:
- Ability to add ad-hoc chart dependencies/aliases, without forking the chart (Fixes#876 )
- Ability to patch resulting K8s resources before installing the helm chart
- Ability to install a kustomization as a chart (Requires `kustomize` binary to be available in `$PATH`
- Ability to install a directory of K8s manifests as a chart
- etc.