Open cirocosta opened 3 years ago
the following patch works but, I imagine there might be a better approach:
diff --git a/pkg/kbld/cmd/relocate.go b/pkg/kbld/cmd/relocate.go
index 863feca..d41eaaa 100644
--- a/pkg/kbld/cmd/relocate.go
+++ b/pkg/kbld/cmd/relocate.go
@@ -120,6 +120,13 @@ func (o *RelocateOptions) updateRefsInResources(
imageRefs := ctlser.NewImageRefs(resContents, conf.SearchRules())
imageRefs.Visit(func(imgURL string) (string, bool) {
+ ref, err := regname.NewDigest(imgURL)
+ if err != nil {
+ panic(err)
+ }
+
+ imgURL = ref.Name()
+
outputImg, found := resolvedImages.FindByURL(UnprocessedImageURL{imgURL})
if found {
return outputImg.URL, true
Thanks for reporting this @cirocosta. I have been able to reproduce the issue and can confirm your patch resolves the issue. Thank you for debugging this and pointing to where the error occurred.
In debugging this myself locally, I am also seeing that the imgURL
is not found as shown below:
With the patch, the imgURL
is properly found and the relocation goes through properly:
as a workaround you should be able to do this for now:
kbld -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.18.1/release.yaml > manifest.yml
kbld relocate --repository $registry -f manifest.yml
first kbld "normalizes" it to pure digest form. we'll report back with a fix a bit later.
Hi! š
I recently hit what seems to be a bug in how
kbld
keeps track of processed images:it appears to me that the possible bug is somewhere around
https://github.com/vmware-tanzu/carvel-kbld/blob/371a1f845d6c2c0e1e1a8d45061a6b05447969c6/pkg/kbld/cmd/relocate.go#L123-L128
where
FindByURL
is passing the URL containing the tag ($repo:$tag@$digest
) but we're adding to the map of processed images the non-tagged formhttps://github.com/vmware-tanzu/carvel-kbld/blob/371a1f845d6c2c0e1e1a8d45061a6b05447969c6/pkg/kbld/cmd/processed_images.go#L25-L30
Am I reading it correctly? happy to help in any form :))
thanks!