-
Notifications
You must be signed in to change notification settings - Fork 456
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
Using crictl rmi
doesn't actually remove anything
#964
Comments
Seems to be known: The internal error is:
But removing by digest doesn't work either, even if it gives a different internal error.
None of these are propagated to |
It was a problem with the documentation, the command only expects full Id (sha256: etc) Apparently trying to remove an image that does not exist, or an invalid Id, is not an error. if err == store.ErrNotExist {
// return empty without error when image not found.
return &runtime.RemoveImageResponse{}, nil
} The workaround is to use $ sudo crictl pull busybox:latest
Image is up to date for busybox@sha256:ef320ff10026a50cf5f0213d35537ce0041ac1d96e9b7800bafd8bc9eff6c693
$ sudo crictl images --no-trunc busybox:latest
IMAGE TAG IMAGE ID SIZE
busybox latest sha256:7a80323521ccd4c2b4b423fa6e38e5cea156600f40cd855e464cc52a321a24dd 1.24MB
$ sudo crictl rmi sha256:7a80323521ccd4c2b4b423fa6e38e5cea156600f40cd855e464cc52a321a24dd
Deleted: busybox:latest
$ sudo crictl images busybox:latest
IMAGE TAG IMAGE ID SIZE |
Related to this, an image with no associated $ crictl images -o json | jq '.images[] |select(.repoTags == [])'
{
"id": "sha256:0ebe7501b7b5ada018c460eb2519066b7c897c71214fff4aea4550513c04bfd8",
"repoTags": [],
"repoDigests": [
"docker.io/library/import-2022-11-16@sha256:ffd9f8a307fab422201b95fd1de54e21a7a71de465c35ab4203f02480cc816cd"
],
"size": "2109278",
"uid": null,
"username": "",
"spec": null
}
$ crictl rmi sha256:0ebe7501b7b5ada018c460eb2519066b7c897c71214fff4aea4550513c04bfd8
$ echo $?
0
$ crictl images -o json | jq '.images[] | select(.id == "sha256:0ebe7501b7b5ada018c460eb2519066b7c897c71214fff4aea4550513c04bfd8")'
{
"id": "sha256:0ebe7501b7b5ada018c460eb2519066b7c897c71214fff4aea4550513c04bfd8",
"repoTags": [],
"repoDigests": [
"docker.io/library/import-2022-11-16@sha256:ffd9f8a307fab422201b95fd1de54e21a7a71de465c35ab4203f02480cc816cd"
],
"size": "2109278",
"uid": null,
"username": "",
"spec": null
} |
@pmengelbert I cannot reproduce, as long as you give the full id then it removes fine. At least with cri-dockerd, so maybe something that is specific to containerd-cri or crio ? |
@afbjorklund I do face a similar issue |
The --debug output should show the actually request/response... Does it work better, if you use |
@thibaut-lo please use --debug output as suggested and also what runtime/versions do you use? |
What happened:
Removing images with cri-tools doesn't seem to be working ?
What you expected to happen:
The image should be removed, or at least an error reported ?
Says
Deleted:
How to reproduce it (as minimally and precisely as possible):
sudo crictl rmi
Anything else we need to know?:
Workaround:
docker rmi
Environment:
cat /etc/os-release
): Ubuntu 20.04.4 LTSuname -a
): 5.4.0-122-genericThe text was updated successfully, but these errors were encountered: