Skip to content

fix: propagate --oci-plain-http to chartify for all chart-preparing commands - #2826

Merged
yxxhero merged 5 commits into
helmfile:mainfrom
yxxhero:fix/oci-plain-http-chartify-2824
Oct 16, 2026
Merged

yxxhero merged 5 commits into
helmfile:mainfrom
yxxhero:fix/oci-plain-http-chartify-2824

Conversation

@yxxhero

@yxxhero yxxhero commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Problem

Fixes #2824

The global --oci-plain-http flag was only wired into state.ChartPrepareOptions.HelmOCIPlainHTTP for the template command. For apply, sync, diff, lint, unittest and fetch, the flag never reached chartify, so whenever a release went through chartification (adhoc dependencies:, patches, transformers, injectors, …), chartify's internal helm dependency up against OCI chart dependencies was issued without --plain-http and failed against plain-HTTP OCI registries:

Error: could not download oci://...: failed to perform "FetchReference" on source: Get "https://.../v2/.../manifests/...": dial tcp ...:443: connect: connection refused

Note the per-repository plainHttp: true field does not help here: it only adds --plain-http to the helm pull of the release chart, not to chartify's separate helm dependency up invocation.

Solution

Add HelmOCIPlainHTTP: a.HelmOCIPlainHTTP to the ChartPrepareOptions passed by run.WithPreparedCharts in Diff(), Lint(), Unittest(), Fetch(), Sync() and Apply() — mirroring what Template() already does (pkg/app/app.go). For completeness, Destroy() and Test() are wired too, since they share the same chartify path (helm dependency up on chartified charts) and hit the same failure. status/build/show-dag/list/write-values don't need it: they either skip chart prep entirely or hard-code SkipDeps: true.

The flag flows through st.processChartification → chartifyOpts.OCIPlainHTTP → chartify, which appends --plain-http to helm dependency up on 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: runs helmfile lint --oci-plain-http. lint chartifies the release exactly like template/apply/sync/diff do, protecting those assignments.
  • issue_2824_fetch_adhoc_oci_dep: runs helmfile fetch --oci-plain-http on a local chart directory without Chart.yaml — the one chart shape for which fetch enters chartification (NeedsChartifyForLocalDir in pkg/state). Chartify then resolves the adhoc OCI dependency with its own helm dependency up, so the case directly protects the added Fetch() assignment; a plain fetch of a packaged or regular local chart never chartifies (it goes through helm dependency build, which already handles --plain-http at the helmexec layer).

Before this fix, both cases fail on Helm 4: chartify's helm dependency up dials https:// against the plain-HTTP registry and is refused. With it, the pull succeeds.

Verification

  • CI (this PR): unit + e2e snapshot tests across Helm v3.18.6 / v3.22.0 / v4.3.0, integration tests on minikube

…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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 HelmOCIPlainHTTP into 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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]>
@yxxhero
yxxhero merged commit 254b2aa into helmfile:main Oct 16, 2026
17 checks passed
hbjydev pushed a commit to hbjydev/phoebe that referenced this pull request Oct 20, 2026
…) (#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 [@&#8203;ban11111](https://github.com/ban11111) in [#&#8203;2813](helmfile/helmfile#2813)
- add trackLogsUntilReady flag by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2814](helmfile/helmfile#2814)
- feat: dir= selector for path-based release filtering and traversal skip by [@&#8203;dschmidt](https://github.com/dschmidt) in [#&#8203;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 [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2818](helmfile/helmfile#2818)
- build(deps): bump github.com/sashabaranov/go-openai from 1.42.1 to 1.43.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2819](helmfile/helmfile#2819)
- build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.46.0 to 1.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2815](helmfile/helmfile#2815)
- build(deps): bump gitpython from 3.1.59 to 3.1.62 in /docs by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2820](helmfile/helmfile#2820)
- build(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2827](helmfile/helmfile#2827)
- add trackLogsInterval option by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2825](helmfile/helmfile#2825)
- build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.4 to 2.2.5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2821](helmfile/helmfile#2821)
- build(deps): bump go.opentelemetry.io/proto/otlp from 1.11.0 to 1.11.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2822](helmfile/helmfile#2822)
- build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.71.0 to 0.72.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;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 [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2828](helmfile/helmfile#2828)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.30 to 0.0.31 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2829](helmfile/helmfile#2829)
- build(deps): bump golang.org/x/term from 0.46.0 to 0.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2830](helmfile/helmfile#2830)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.6 to 1.33.9 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2831](helmfile/helmfile#2831)
- build(deps): bump github.com/gookit/color from 1.6.1 to 1.6.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2833](helmfile/helmfile#2833)
- fix: skip recreatePods on Helm 4, which removed --recreate-pods by [@&#8203;Cayan](https://github.com/Cayan) in [#&#8203;2832](helmfile/helmfile#2832)
- chore: bump Helm to v3.22.1 and v4.3.1 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2834](helmfile/helmfile#2834)
- fix: propagate --oci-plain-http to chartify for all chart-preparing commands by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants