Can't relocate images containing tag *and* digest
- Dominant language
- Go
- Stars
- 329
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
Hi! 👋
I recently hit what seems to be a bug in how `kbld` keeps track of processed images:
```console
$ kbld relocate --repository $registry -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.18.1/release.yaml
relocate | exporting 2 images...
relocate | will export gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller:v0.18.1@sha256:0d1dcd40d032e940da112460dfbff8da9a423cfcb2397388f2703548b7d406ef
relocate | will export gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook:v0.18.1@sha256:96cebd8a17eb204aee86a4ec8cd576fd0d2bbdefc74bdfe17d46b2bdf0bc5e6c
relocate | exported 2 images
relocate | importing 2 images...
relocate | importing gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller@sha256:0d1dcd40d032e940da112460dfbff8da9a423cfcb2397388f2703548b7d406ef -> /tekton@sha256:0d1dcd40d032e940da112460dfbff8da9a423cfcb2397388f2703548b7d406ef...
relocate | importing gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook@sha256:96cebd8a17eb204aee86a4ec8cd576fd0d2bbdefc74bdfe17d46b2bdf0bc5e6c -> /tekton@sha256:96cebd8a17eb204aee86a4ec8cd576fd0d2bbdefc74bdfe17d46b2bdf0bc5e6c...
relocate | imported 2 images
kbld: Error:
- Expected to find image for 'gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller:v0.18.1@sha256:0d1dcd40d032e940da112460dfbff8da9a423cfcb2397388f2703548b7d406ef'
- Expected to find image for 'gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook:v0.18.1@sha256:96cebd8a17eb204aee86a4ec8cd576fd0d2bbdefc74bdfe17d46b2bdf0bc5e6c'
```
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 form
https://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!
Contributor guide
Assessment
This issue has not been assessed yet.