Commit d1b22d0
Roy Lin
fix(cri): resolve image reference in RemoveImage (rmi by short tag)
ImageStatus resolves an image reference via resolve_digest (so `crictl inspecti
alpine:latest` finds an image stored under its fully-qualified name), but
RemoveImage passed the raw reference straight to ImageStore::remove, which only
matches an exact key or exact digest — never normalizing a short tag. So
`crictl rmi alpine:latest` failed with 'Image not found' for an image stored as
docker.io/library/alpine:latest, even though inspecti just resolved it.
Resolve the reference to its digest the same way ImageStatus does, then remove
by that digest (dropping every reference to the image — the CRI 'remove the
image' semantic). Falls back to the raw ref for a bare digest/id or an unknown
image, preserving the prior not-found behavior.
Found by running the crictl CRI smoke test on current main (16/18 -> rmi was one
of the 2 failures). clippy -D warnings clean; 237 cri tests pass.1 parent 9687e8d commit d1b22d0
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
325 | 337 | | |
326 | | - | |
| 338 | + | |
327 | 339 | | |
328 | 340 | | |
329 | 341 | | |
| |||
0 commit comments