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

PlainImage should not fall back onto first image in the image index #142

Closed
cppforlife opened this issue May 7, 2021 · 5 comments
Closed
Assignees
Labels
bug This issue describes a defect or unexpected behavior can be replicated A bug can be repoduced carvel accepted This issue should be considered for future work and that the triage process has been completed

Comments

@cppforlife
Copy link
Contributor

cppforlife commented May 7, 2021

Currently imgpkg pull and copy end up pulling/copying first image of the image index. This is quite misleading because copy succeeds but actually does not copy image index (and other images in it). For pull it's surprising as well -- it's probably better to return an error to let the user know to give single image reference.

(i realized this when trying to imgpkg copy -i nginx@sha256:... --to-repo dkalinin/private-repo and not being able to pull that exact digest from private-repo)


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.

@cppforlife cppforlife added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels May 7, 2021
@joaopapereira
Copy link
Member

joaopapereira commented May 7, 2021

Currently imgpkg pull and copy end up pulling/copying first image of the image index

When you are talking about the pull here, what do you see happening?
If you execute imgpkg pull we do not download any image.

@joaopapereira
Copy link
Member

this is a imgpkg copy -i so we do download the image info

@pivotaljohn pivotaljohn removed the carvel triage This issue has not yet been reviewed for validity label May 7, 2021
@joaopapereira
Copy link
Member

I tried the following:

  1. Copy nginx:latest to a local registry
imgpkg copy -i nginx:latest --to-repo localhost:5000/nginx
copy | exporting 1 images...
copy | will export index.docker.io/library/nginx@sha256:61191087790c31e43eb37caa10de1135b002f10c09fdda7fa8a5989db74033aa
copy | exported 1 images
copy | importing 1 images...
 51.25 MiB / 51.25 MiB [=============================================================================================================================================================================================] 100.00% 3.34 GiB/s 0s
copy | done uploading images
Succeeded
  1. Download the arm64 Linux OCI Image by SHA and it fails
docker pull localhost:5000/nginx@sha256:dcc53ad7391323bd425b95724cde076326a640eda336bd34bc2376ed3614138f
Error response from daemon: manifest for localhost:5000/nginx@sha256:dcc53ad7391323bd425b95724cde076326a640eda336bd34bc2376ed3614138f not found: manifest unknown: manifest unknown

Looks like that the first hint that this is not working 100% is in the output of the copy command. imgpkg should have copied 8 images + the index image itself but from the output, only 1 image is being copied.

In a different topic, the output of the copy command doesn't look like it takes into account indexes, nevertheless, they are copied.

@joaopapereira joaopapereira added can be replicated A bug can be repoduced carvel accepted This issue should be considered for future work and that the triage process has been completed labels Jun 1, 2021
@joaopapereira
Copy link
Member

joaopapereira commented Jun 3, 2021

images.NewImages is only used by the PlainImage. Maybe the best approach would be to remove this struct and directly in PlainImage check if the provided Image is an Image or an Index.

Another point is the PlainImage.Pull should fail if the provided PlainImage is not an image, but it should not panic (current behavior)

@DennisDenuto
Copy link
Contributor

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 can be replicated A bug can be repoduced carvel accepted This issue should be considered for future work and that the triage process has been completed
Projects
None yet
Development

No branches or pull requests

4 participants