Skip to content

feat: suggest helm pull when a skipped layer is a Helm chart - #2363

Closed
VanshajPoonia wants to merge 2 commits into
oras-project:mainfrom
VanshajPoonia:fix/1177-helm-pull-hint
Closed

VanshajPoonia wants to merge 2 commits into
oras-project:mainfrom
VanshajPoonia:fix/1177-helm-pull-hint

Conversation

@VanshajPoonia

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

oras pull skips layers without a title annotation, and every layer of a Helm chart is one of those. The output then told the user to run oras copy ... --to-oci-layout, which does not give them a usable chart.

The text handler now remembers when a skipped descriptor is the Helm config (application/vnd.cncf.helm.config.v1+json). If the target is a remote registry it prints Use 'helm pull oci://<repo> --version <tag>' to pull the Helm chart. For a digest reference it prints helm pull oci://<repo>@<digest>. OCI layout targets and other artifacts keep the oras copy hint. JSON and template output are unchanged.

Which issue(s) this PR fixes:
Fixes #1177

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test? (unit tests only, see below)
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header? (no new files)

Checked against a real chart. oras pull registry-1.docker.io/bitnamicharts/nginx:25.2.19 from this branch ends with Use 'helm pull oci://registry-1.docker.io/bitnamicharts/nginx --version 25.2.19' to pull the Helm chart. I also ran helm pull oci://registry-1.docker.io/bitnamicharts/nginx@sha256:7f81919e... with Helm 4.3.2 and it downloads the chart, so the digest form works. I did not test Helm 3. The E2E suite needs Docker and was not run. go test ./cmd/oras/internal/display/... ./cmd/oras/root/, go vet and gofmt pass.

oras pull skips layers without a title annotation, which is every layer of
a Helm chart. For a chart in a registry the hint now points to helm pull
instead of oras copy.

Fixes oras-project#1177

Signed-off-by: Vanshaj Poonia <[email protected]>

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't love the way oras pull works, but I don't think we should be doing this. I think oras pull should just pull by default, but not sure where it should pull.o

@VanshajPoonia

Copy link
Copy Markdown
Contributor Author

Understood. Thanks for the review. I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

if an artifact cannot be pulled by oras pull, recommend oras user to use dedicated tool

2 participants