Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't bundle Helm OCI artifacts #464

Closed
nbrns opened this issue Dec 15, 2022 · 4 comments · Fixed by #635
Closed

Can't bundle Helm OCI artifacts #464

nbrns opened this issue Dec 15, 2022 · 4 comments · Fixed by #635
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@nbrns
Copy link

nbrns commented Dec 15, 2022

What steps did you take:

I'd like to use imgpkg to ship helm charts by tar, when they are stored as OCI images.
Create a helm chart and push it to an OCI registry.

helm create foo
helm package foo
helm push .\foo-0.1.0.tgz oci://localhost:5000

Create a small bundle:

.imgpkg/bundle.yaml:

apiVersion: imgpkg.carvel.dev/v1alpha1
kind: Bundle
metadata:
  name: bar
authors:
- name: bar Team
  email: bar@example.com
websites:
- url: carvel.dev/imgpkg

File: helm-charts.yaml

helm-charts:
  - image: localhost:5000/foo:0.1.0

Create imgpkg lock using kbld:

kbld -f . --imgpkg-lock-output .imgpkg/images.yml

Image SHA is correctly resolved, everything fine until here.

Push and copy imgpkg bundle

imgpkg push -b localhost:5000/foo/bar:v0.0.1 -f .
imgpkg copy -b localhost:5000/foo/bar:v0.0.1 --to-tar ./bundle.tar

What happened:

I get the following error from imgpkg copy:

imgpkg copy -b localhost:5000/foo/bar:v0.0.1 --to-tar ./bundle.tar
copy | exporting 2 images...
copy | will export localhost:5000/foo/bar@sha256:ffa285af42d1011a89b4f719bc40acf76cb4be429592da7930249edbbe62ac20
copy | will export localhost:5000/foo@sha256:eb26401bbf547fd928f3ccdcda031c3aa99dda7198904a0be983abb5701d5647
copy | exported 2 images

imgpkg: Error: Collecting packaging metadata: mismatched fs layers (1) and diff ids (0)

What did you expect:

Bundle with Helm OCI image included.

Environment:

  • imgpkg version (use imgpkg --version): 0.34.1
  • Docker registry used (e.g. Docker HUB): https://hub.docker.com/_/registry
  • OS (e.g. from /etc/os-release): Ubuntu 22.04.1 LTS (but in WSL)

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@nbrns nbrns added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Dec 15, 2022
@joaopapereira
Copy link
Member

Hey @nbrns thanks for creating this issue.

I started to look into this issue and in fact imgpkg does work well with images that which the configuration is not equal to the OCI spec. In the case of Helm images, their configuration has the MediaType application/vnd.cncf.helm.config.v1+json and the configuration does not have any reference to the required field in the OCI spec called RootFS, which is used to calculate the diff ids. This is what is causing the issue.

Going to accept this bug, unfortunately, I am not 100% when the maintainers will have some time to pick this issue up. Can you tell us how impactful is this for you to see if we can bump the priority of this issue up? We are also happy to review PRs that might fix this issue.

Also some information for anyone that is interested in doing a PR to fix this issue.

  • The error is bubbling up in this line
  • Possible solution is to make sure we only retrieve the DiffIDS if the config of the image is OCI (application/vnd.oci.image.config.v1+json) or Docker (application/vnd.docker.container.image.v1+json). But in this case we should make sure that there is no unexpected impacts when we do not calculate and provide the diff ids

@joaopapereira joaopapereira added carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed carvel triage This issue has not yet been reviewed for validity labels Dec 21, 2022
@lsoica
Copy link

lsoica commented Jan 17, 2023

I just hit this issue as well. My use case is that I want to package and ship my k8s app as a single bundle. My app is composed of multiple helm charts and container images, all of them published in OCI registry.

@liangyuanpeng
Copy link

Helm oci chart is a very common scenario, it would be great if imgpkg can support this case.

Can i work for it? @joaopapereira

@joaopapereira
Copy link
Member

Hey @liangyuanpeng yes you can. Let me know if you need any extra information or any help doing this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants