containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
8.01k stars 594 forks source link

nerdctl rmi can be broken by using tag names with repo short sha #3016

Open apostasie opened 4 months ago

apostasie commented 4 months ago

Description

When an image uses a tag that is a short version of another (unrelated) image repo sha, nerdctl rmi will break down.

This is another aspect of one of the many issues with our current image lookup implementation.

Steps to reproduce the issue

nerdctl pull busybox
nerdctl pull alpine
shortid="$(nerdctl inspect busybox | jq -rc .[0].RepoDigests[0])"
shortid="${shortid##*:}"
shortid="${shortid:0:8}"
nerdctl tag alpine "$shortid"
nerdctl rmi "$shortid"

Describe the results you received and expected

FATA[0000] 1 errors:
multiple IDs found with provided prefix: 5eef5ed3

Should have just worked and removed the tagged version of alpine.

What version of nerdctl are you using?

1.7.6

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

apostasie commented 4 months ago

Can we reopen?

3017 was not meant to fix this (yet).

apostasie commented 4 months ago

@yankay @AkihiroSuda can we reopen this?

haytok commented 3 days ago

Hi, team

I want to work on this issue, so could you assign this ?