File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,8 +322,20 @@ impl ImageService for BoxImageService {
322322
323323 tracing:: info!( image = %image_spec. image, "CRI RemoveImage" ) ;
324324
325+ // Resolve the reference to its digest the same way ImageStatus does, so
326+ // `rmi <short-tag>` matches an image stored under its fully-qualified name
327+ // (ImageStatus resolved it but RemoveImage previously passed the raw ref to
328+ // store.remove, which only exact-matches a key or digest). Removing by the
329+ // resolved digest drops every reference to the image — the CRI
330+ // "remove the image" semantic. Fall back to the raw ref (a bare digest/id,
331+ // or an unknown image) so store.remove still handles it / errors as before.
332+ let target = self
333+ . resolve_digest ( & image_spec. image )
334+ . await
335+ . unwrap_or_else ( || image_spec. image . clone ( ) ) ;
336+
325337 self . image_store
326- . remove ( & image_spec . image )
338+ . remove ( & target )
327339 . await
328340 . map_err ( box_error_to_status) ?;
329341
You can’t perform that action at this time.
0 commit comments