-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
"cache add" with sha256 sum: "Failed to cache... repository can only contain the runes" #3822
Comments
That sounds totally reasonable, and more like a bug than a feature request. What command-line are you using, and what currently happens when you try to add an image to a cache with a SHA? |
@tstromberg here is an example of the cache add with sha256 with error
Error
|
Thanks for the additional information - it makes it much clearer what's going on. I'm not sure what needs to be changed to make this work, but would be happy to approve any PR's that address this issue. |
if I get bandwidth will try sending PR your way . |
I think we should be using https://github.com/google/go-containerregistry/blob/master/pkg/name/ref.go#L41_L50 tag, err := name.NewTag(image, name.WeakValidation)
if err != nil {
return errors.Wrap(err, "creating docker image name")
} |
Gaah, unfortunately there is currently no tarball Write that accepts Digest (or Reference)... td := tarDescriptor{
singleImageTarDescriptor{
Config: cfgName.String(),
RepoTags: []string{tag.String()},
Layers: layerFiles,
},
} For a digest tarball, this is supposed to say |
@kameshsampath : Did a sample implementation here: master...afbjorklund:reference But those vendor changes should go upstream, and they added some more features to write.go. |
@afbjorklund - thanks, not sure I make sense here can we reuse this code ? https://github.com/knative/serving/blob/master/pkg/reconciler/v1alpha1/revision/resolve.go |
That code looks very similar, i.e. they are both using name.Tag and name.Digest ? The main remaining problem with g/go-cr is that it is impossible to load digests. But minikube doesn't really care, since we only use it to save tarballs anyway... In case it wasn't obvious, the above code snippet does fix loading of digests. |
CC: @vdemeester, Vincent did patch the go/go-cr for another PR, he might be able to help us. |
@afbjorklund upstream's PR got merged 👼 Do you want to open a PR here or should I go ahead ? 👼 |
I'm giving it a try: |
Oops, look like I broke upstream:
My understanding of Go inheritance is limited. EDIT: fortunately, it wasn't me. Read too fast, the ref is fine - it was someone else that broke API: |
That was me. 👋 Luckily the fix is straightforward, just remove the Sorry for the speedbump, we're hoping to stabilize the go-containerregistry library soon, and do real releases. |
Works as advertised, the only difference is in the --- a/manifest.json 1970-01-01 01:00:00.000000000 +0100
+++ b/manifest.json 1970-01-01 01:00:00.000000000 +0100
@@ -1 +1 @@
-[{"Config":"sha256:025ab64f8cc830417dc6d85b1f2cbdff9030d1ba1bd781a44f3191f53450214b","RepoTags":["gcr.io/kaniko-project/executor:latest"],"Layers":["20aeb61b9e385a5ee65b8985abaa1b3dd01a301247c9ceb8048ff4dd70da81a9.tar.gz","76dd575757341869d3268e5a80f6492487a3ff4f2cf2fb220bf1280e99ce49a3.tar.gz","ec294f5524f9bb08d9e715bb4ff11c11d722fe46517408f8edc9c21378cca882.tar.gz","6352599e53cdf9f3c68b6f37ae5aa3e011f5f94386c839e63c5e2ca2b07eef8b.tar.gz","f5344ea33cc949b8da96ef152cc55add5428fdcace3436e14614c7833329398d.tar.gz","ec44e76f69b1fbdaa890e4724840a3c82c950680b78dc354ecdef905f9f9496e.tar.gz","ceb0b51a5b370acaa47fe3d52833b65252f3af2dc82bdcb3bd9619aafb6d5a25.tar.gz"]}]
\ No newline at end of file
+[{"Config":"sha256:025ab64f8cc830417dc6d85b1f2cbdff9030d1ba1bd781a44f3191f53450214b","RepoTags":null,"Layers":["20aeb61b9e385a5ee65b8985abaa1b3dd01a301247c9ceb8048ff4dd70da81a9.tar.gz","76dd575757341869d3268e5a80f6492487a3ff4f2cf2fb220bf1280e99ce49a3.tar.gz","ec294f5524f9bb08d9e715bb4ff11c11d722fe46517408f8edc9c21378cca882.tar.gz","6352599e53cdf9f3c68b6f37ae5aa3e011f5f94386c839e63c5e2ca2b07eef8b.tar.gz","f5344ea33cc949b8da96ef152cc55add5428fdcace3436e14614c7833329398d.tar.gz","ec44e76f69b1fbdaa890e4724840a3c82c950680b78dc354ecdef905f9f9496e.tar.gz","ceb0b51a5b370acaa47fe3d52833b65252f3af2dc82bdcb3bd9619aafb6d5a25.tar.gz"]}]
\ No newline at end of file Similar to the output from |
Right now the minikube cache command allows to cache only images with tag, it will be great to support caching images with SHAs
The text was updated successfully, but these errors were encountered: