Skip to content

feat(k8s): render an OCI chart in image-pins - #7373

Merged
dan-petty merged 2 commits into
mainfrom
feat/7368-render-an-oci-chart-in-image
Nov 27, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/7368-render-an-oci-chart-in-image

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops k8s image-pins renders a chart source whose repoURL is a path of an OCI registry. Argo CD writes such a source with no scheme, for example ghcr.io/actions/actions-runner-controller-charts. The check gives Helm the chart reference oci://<repoURL>/<chart>, which is the reference that Argo CD pulls. Helm reads --repo only as an http or https chart repository, so that form stays for those repositories. A registry path with a port is a registry path too.

The check stopped at such an Application with an ImagePinError. Some projects publish their charts only in an OCI registry, so an environment repository that installs one could not pass the check that its CI runs.

devops k8s catalog renders each Application with the same function, so it renders such a chart too.

Closes #7368

Change: openspec/changes/archive/2026-11-27-7368-render-an-oci-chart-in-image/

A chart source whose repoURL is a path of an OCI registry renders with
helm template <release> oci://<repoURL>/<chart>. The refusal of such a
source is removed.

Refs #7368
@dan-petty dan-petty added type/feature Type feature: a new function scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 27, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence for the change, on head 148b7b494 (base 57f0116e3).

Premise, with the real tool (Helm v4.3.2, the helm of the devtools image 1.3.1)

Command Result
helm template arc oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller --version 0.15.1 --namespace arc-systems --skip-tests exit 0, 300 lines, image ghcr.io/actions/gha-runner-scale-set-controller:0.15.1
the same command with --values <file> (replicaCount: 2) exit 0, the render holds replicas: 2
helm template arc gha-runner-scale-set-controller --repo oci://ghcr.io/actions/actions-runner-controller-charts --version 0.15.1 --namespace arc-systems --skip-tests exit 1: Error: looks like "oci://ghcr.io/actions/actions-runner-controller-charts" is not a valid chart repository or cannot be reached
the first command with --version 0.0.0-none exit 1: Error: failed to perform "FetchReference" on source: ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller:0.0.0-none: not found

Argo CD (master on 2026-11-27): IsHelmOciRepo in util/helm/client.go reads a repoURL with no :// as an OCI registry, also one with a port. PullOCI in util/helm/cmd.go pulls oci://<repo>/<chart>.

The command with the real Helm and the real registry

The tree is a scratch folder with one multi-source Application: repoURL: ghcr.io/actions/actions-runner-controller-charts, chart: gha-runner-scale-set-controller, targetRevision: 0.15.1, releaseName: arc, and one value file of a values ref source.

Command Base Head
uv run devops k8s image-pins --k8s-dir <tree>/k8s exit 1: Application arc names an OCI chart repository, which the check does not render exit 0: ghcr.io/actions/gha-runner-scale-set-controller resolves at ghcr.io
the same command with --dry-run exit 1, the same refusal exit 0: Would run command: helm template arc oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller --version 0.15.1 --namespace arc-systems --skip-tests --values <tree>/k8s/arc/values.yaml
the same command with targetRevision: 0.0.0-none exit 1, the same refusal exit 1: helm template arc failed: Error: failed to perform "FetchReference" on source: ...:0.0.0-none: not found

Tests and checks before the push

  • The 4 new cases of tests/k8s/test_image_pins.py fail with the source of the base and pass on the head.
  • uv run devops ci test tests/k8s/test_image_pins.py tests/k8s/test_k8s_catalog.py -n 4: exit 0.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: exit 0.
  • uv run mypy src/devops_cli/k8s/image_pins.py: exit 0.

The other readers of a chart source

  • chart_sources and its one caller (deploy-stack) read the version and the value files only. The Argo CD gate reads the value files only. helm_records reads the release name only. None refuses a registry path.
  • devops k8s catalog renders with application_renders, so the change covers its run. Its dry-run plan writes a helm template line of its own: fix(k8s): the catalog dry run names the render command of the run #7371.

Not verified

  • No run of devops k8s catalog on a tree with a chart of an OCI registry.
  • No chart of a private registry. The check gives Helm no credential of its own.

Found outside the change

GitHub checks on 148b7b494

Each check of the head commit passes: Static Analysis, Tests & Coverage and its 5 shards, Semantic PR title, Image Pins, Changed-Test Independence and its 3 runs, CodeQL, Analyze (python), Analyze (actions), Service Image, Runner Image, Design Tokens, Docs Site Build, zizmor, trivy-config and devops-cli. The check Trivy of code scanning is neutral ("1 configuration not found"), as on other pull requests. Fail-to-Pass Check, Plan Check, Dependency Freshness, Test Job Duration and Tests on Main are skipped: they do not apply to this pull request.

@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 02:10
@dan-petty
dan-petty merged commit 7058d54 into main Nov 27, 2026
29 checks passed
@dan-petty
dan-petty deleted the feat/7368-render-an-oci-chart-in-image branch November 27, 2026 03:01
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.224.0](v0.223.5...v0.224.0)
(2026-11-27)


### Features

* **k8s:** render an OCI chart in image-pins
([#7373](#7373))
([7058d54](7058d54))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(k8s): render an OCI chart in image-pins

1 participant