carvel-dev / carvel-dev/kbld

Can't relocate images containing tag *and* digest

Open
#72 4 comments 0 reactions 0 assignees View on GitHub
bug helping with an issue
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.