Repository navigation
fix: propagate --oci-plain-http to chartify for all chart-preparing commands - #2826
Conversation
…ommands The global --oci-plain-http flag was only wired into ChartPrepareOptions for the template command. For apply, sync, diff, lint, unittest, fetch (and destroy/test, which share the same chartify path), the flag never reached chartify, so its internal 'helm dependency up' against OCI chart dependencies was issued without --plain-http and failed against plain-HTTP OCI registries (the per-repository plainHttp field only covers the helm pull of the release chart, not chartify's dependency update). Add HelmOCIPlainHTTP: a.HelmOCIPlainHTTP to the ChartPrepareOptions of these commands, mirroring Template(), and add a regression test that fetches a release with an adhoc OCI dependency from a plain-HTTP local registry. Fixes helmfile#2824 Signed-off-by: yxxhero <[email protected]> Signed-off-by: yxxhero <[email protected]>
The pull/fetch command skips chartify (except for local dirs without Chart.yaml) and runs helmexec.BuildDeps instead, which already handles --plain-http at the exec layer. lint goes through chartify like template/apply/sync/diff do, and needs no cluster, so it reproduces issue helmfile#2824: before the fix, chartify's 'helm dependency up' on the adhoc OCI dependency fails against the plain-HTTP registry on Helm 4. Signed-off-by: yxxhero <[email protected]> Signed-off-by: yxxhero <[email protected]>
Fix the Helm 3 golden with the exact output captured from CI (helm lint prints the chartified chart path and extra blank lines). The Helm 4 golden follows the same shape plus the Pulled/Digest lines emitted by helm dependency up. Signed-off-by: yxxhero <[email protected]> Signed-off-by: yxxhero <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The regression test invokes lint rather than the documented Fetch path, leaving Fetch’s command-specific wiring unprotected.
1 open finding
What changed in this PR
Propagates plain-HTTP OCI configuration into chartify across chart-preparing commands.
Changes:
- Wires
HelmOCIPlainHTTPinto eight command preparation paths. - Adds Helm 3/4 snapshots for an ad-hoc OCI dependency via
lint.
| File | Description |
|---|---|
pkg/app/app.go |
Propagates the OCI plain-HTTP option. |
test/e2e/template/helmfile/testdata/snapshot/issue_2824_lint_adhoc_oci_dep/config.yaml |
Configures the lint regression case. |
test/e2e/template/helmfile/testdata/snapshot/issue_2824_lint_adhoc_oci_dep/input.yaml.gotmpl |
Defines an ad-hoc OCI dependency. |
test/e2e/template/helmfile/testdata/snapshot/issue_2824_lint_adhoc_oci_dep/output.yaml |
Records Helm 3 output. |
test/e2e/template/helmfile/testdata/snapshot/issue_2824_lint_adhoc_oci_dep/output-helm4.yaml |
Records Helm 4 output. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Port is not specified, will be dynamically allocated to avoid conflicts | ||
| chartifyTempDir: temp2824 | ||
| helmfileArgs: | ||
| - lint |
There was a problem hiding this comment.
Addressed in ea9160b with a dedicated fetch scenario (issue_2824_fetch_adhoc_oci_dep).
The subtlety: helmfile fetch only enters chartification when the chart is a local directory without Chart.yaml (NeedsChartifyForLocalDir in pkg/state/state.go — helmfileCommand != "pull" || chartification.NeedsChartifyForLocalDir). A packaged or regular local chart never chartifies under fetch; it goes through helm dependency build, which already appends --plain-http at the helmexec layer.
So the new case fetches a manifest-only chart directory (no Chart.yaml) with an adhoc OCI dependency. Chartify then materializes the temp chart and resolves the adhoc dep with its own helm dependency up, which requires the propagated --oci-plain-http on Helm 4 — directly exercising the Fetch() assignment. Before the fix this exact shape fails with the https-dial error from the issue; with it, the pull succeeds.
The PR description's regression-test section is also updated to state both scopes (lint covers the shared chartify path of template/apply/sync/diff; fetch covers the Fetch wiring). The case-local fixture is referenced via a new ./chart/ rewrite in the snapshot harness, since testdata/charts cannot hold unpackaged directories (every chart there is helm packaged and pushed to the test registry).
helmfile fetch only enters chartification when the chart is a local directory without Chart.yaml (NeedsChartifyForLocalDir) — a packaged or regular local chart goes through helm dependency build instead, which already handles --plain-http at the helmexec layer. The new case uses a manifest-only chart directory plus an adhoc OCI dependency, so chartify's own 'helm dependency up' must receive the propagated --oci-plain-http on Helm 4, directly protecting the Fetch() wiring added in this PR. To reference the case-local fixture, the snapshot harness now rewrites './chart/' in inputs to the chart directory shipped next to the case (mirroring the existing '../../charts/' rewrite). The fixture cannot live in the shared testdata/charts directory because every chart there is helm-packaged and pushed to the test registry. Addresses the review finding that only the Lint assignment was covered. Signed-off-by: yxxhero <[email protected]>
For a chartified manifest-only chart, chartify's ReplaceWithRendered strips the Chart.yaml dependencies field and removes charts/ after rendering the adhoc dependency into templates/. The follow-up `helm dependency build` therefore finds no declared dependencies and returns silently (helm3/helm4 Manager short-circuit), so the captured output is just the "Building dependency" log line — confirmed by the Helm 3 CI diff. Helm 4.3.0's Manager has the identical early-return path, so its golden matches. The regression signal remains the command's exit code: without the propagated --oci-plain-http, chartify's `helm dependency up` fails on Helm 4 and the whole fetch errors out. Signed-off-by: yxxhero <[email protected]>
…) (#902) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | patch | `1.8.1` → `1.8.2` | --- ### Release Notes <details> <summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary> ### [`v1.8.2`](https://github.com/helmfile/helmfile/releases/tag/v1.8.2) [Compare Source](helmfile/helmfile@v1.8.1...v1.8.2) #### What's Changed - fix: support escaped commas in --state-values-set by [@​ban11111](https://github.com/ban11111) in [#​2813](helmfile/helmfile#2813) - add trackLogsUntilReady flag by [@​pznamensky](https://github.com/pznamensky) in [#​2814](helmfile/helmfile#2814) - feat: dir= selector for path-based release filtering and traversal skip by [@​dschmidt](https://github.com/dschmidt) in [#​2609](helmfile/helmfile#2609) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.113.4 to 1.114.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2818](helmfile/helmfile#2818) - build(deps): bump github.com/sashabaranov/go-openai from 1.42.1 to 1.43.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2819](helmfile/helmfile#2819) - build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.46.0 to 1.47.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2815](helmfile/helmfile#2815) - build(deps): bump gitpython from 3.1.59 to 3.1.62 in /docs by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2820](helmfile/helmfile#2820) - build(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2827](helmfile/helmfile#2827) - add trackLogsInterval option by [@​pznamensky](https://github.com/pznamensky) in [#​2825](helmfile/helmfile#2825) - build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.4 to 2.2.5 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2821](helmfile/helmfile#2821) - build(deps): bump go.opentelemetry.io/proto/otlp from 1.11.0 to 1.11.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2822](helmfile/helmfile#2822) - build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.71.0 to 0.72.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2823](helmfile/helmfile#2823) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.114.0 to 1.114.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2828](helmfile/helmfile#2828) - build(deps): bump github.com/mattn/go-runewidth from 0.0.30 to 0.0.31 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2829](helmfile/helmfile#2829) - build(deps): bump golang.org/x/term from 0.46.0 to 0.47.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2830](helmfile/helmfile#2830) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.6 to 1.33.9 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2831](helmfile/helmfile#2831) - build(deps): bump github.com/gookit/color from 1.6.1 to 1.6.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2833](helmfile/helmfile#2833) - fix: skip recreatePods on Helm 4, which removed --recreate-pods by [@​Cayan](https://github.com/Cayan) in [#​2832](helmfile/helmfile#2832) - chore: bump Helm to v3.22.1 and v4.3.1 by [@​yxxhero](https://github.com/yxxhero) in [#​2834](helmfile/helmfile#2834) - fix: propagate --oci-plain-http to chartify for all chart-preparing commands by [@​yxxhero](https://github.com/yxxhero) in [#​2826](helmfile/helmfile#2826) **Full Changelog**: <helmfile/helmfile@v1.8.1...v1.8.2> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/London) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/902

Problem
Fixes #2824
The global
--oci-plain-httpflag was only wired intostate.ChartPrepareOptions.HelmOCIPlainHTTPfor the template command. For apply, sync, diff, lint, unittest and fetch, the flag never reached chartify, so whenever a release went through chartification (adhocdependencies:, patches, transformers, injectors, …), chartify's internalhelm dependency upagainst OCI chart dependencies was issued without--plain-httpand failed against plain-HTTP OCI registries:Note the per-repository
plainHttp: truefield does not help here: it only adds--plain-httpto thehelm pullof the release chart, not to chartify's separatehelm dependency upinvocation.Solution
Add
HelmOCIPlainHTTP: a.HelmOCIPlainHTTPto theChartPrepareOptionspassed byrun.WithPreparedChartsinDiff(),Lint(),Unittest(),Fetch(),Sync()andApply()— mirroring whatTemplate()already does (pkg/app/app.go). For completeness,Destroy()andTest()are wired too, since they share the same chartify path (helm dependency upon chartified charts) and hit the same failure.status/build/show-dag/list/write-valuesdon't need it: they either skip chart prep entirely or hard-codeSkipDeps: true.The flag flows through
st.processChartification→chartifyOpts.OCIPlainHTTP→ chartify, which appends--plain-httptohelm dependency upon Helm 4.Regression tests
Two snapshot test cases, both against a plain-HTTP local Docker registry (existing harness) and both driving a release with a local chart plus an adhoc OCI dependency — the reproduction from the issue; neither needs a cluster:
issue_2824_lint_adhoc_oci_dep: runshelmfile lint --oci-plain-http.lintchartifies the release exactly like template/apply/sync/diff do, protecting those assignments.issue_2824_fetch_adhoc_oci_dep: runshelmfile fetch --oci-plain-httpon a local chart directory withoutChart.yaml— the one chart shape for whichfetchenters chartification (NeedsChartifyForLocalDirinpkg/state). Chartify then resolves the adhoc OCI dependency with its ownhelm dependency up, so the case directly protects the addedFetch()assignment; a plainfetchof a packaged or regular local chart never chartifies (it goes throughhelm dependency build, which already handles--plain-httpat the helmexec layer).Before this fix, both cases fail on Helm 4: chartify's
helm dependency updialshttps://against the plain-HTTP registry and is refused. With it, the pull succeeds.Verification