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

Copying from a tarfile fails if the image doesn't exist in the registry anymore #127

Closed
DennisDenuto opened this issue Apr 13, 2021 · 3 comments
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

Comments

@DennisDenuto
Copy link
Contributor

What steps did you take:

  1. Create a bundle that references img1
  2. Copy the bundle to a tarfile
  3. delete img1 from Registry A
  4. copy from the tarfile to Registry A

What happened:

copy | importing 5 images...
copy | importing gcr.io/kubebuilder/kube-rbac-proxy@sha256:a06e7b56c5e1e63b87abb417344f59bf4a8e53695b8463121537c3854c5fda82 -> registry.local:5000/opinions/bundle-relocated@sha256:a06e7b56c5e1e63b87abb417344f59bf4a8e53695b8463121537c3854c5fda82...
copy | imported 0 images
Error: Getting mountable image failed: registry.local:5000/opinions/samples/opinion-server@sha256:e5892efcc2ffa9ca3ab27966300f66b63ba481e186487adfa71c5b9d425e20a8: GET http://registry.local:5000/v2/opinions/samples/opinion-server/manifests/sha256:e5892efcc2ffa9ca3ab27966300f66b63ba481e186487adfa71c5b9d425e20a8: MANIFEST_UNKNOWN: manifest unknown; map[Name:opinions/samples/opinion-server Revision:sha256:e5892efcc2ffa9ca3ab27966300f66b63ba481e186487adfa71c5b9d425e20a8]

What did you expect:
Copy to succeed

Anything else you would like to add:
imgpkg copy is trying to create a mountable object by querying the registry. Either change it to only copy the image from the tarfile, or if querying for an image to get a mountable object fails, fallback to copying from the tarfile

Environment:

  • imgpkg version (use imgpkg --version): v0.6.0
  • Docker registry used (e.g. Docker HUB):
  • OS (e.g. from /etc/os-release): osx
@DennisDenuto DennisDenuto added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Apr 13, 2021
@cppforlife
Copy link
Contributor

if querying for an image to get a mountable object fails, fallback to copying from the tarfile

i think it would great if we can avoid making a network request from an air-gapped environment to external registry.

@DennisDenuto
Copy link
Contributor Author

DennisDenuto commented Apr 13, 2021

i think it would great if we can avoid making a network request from an air-gapped environment to external registry.

The fix in PR #128 will only make a network request Get image Manifest if the source and destination registry url's match.

We are making the assumption that in an airgapped environment, practically speaking the registry URL's will be different.

Technically however, it is possible that a public registry and an airgapped registry share the same registry URL.

In which case, the change introduced in the PR, will fail to Get an image Manifest, and fall back to uploading the images from the tarball instead.

@cari-lynn cari-lynn added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been reviewed for validity labels Apr 14, 2021
@DennisDenuto
Copy link
Contributor Author

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
Projects
None yet
Development

No branches or pull requests

3 participants