Switch to ImageServer.UntagImage in RemoveImage handler
Add an UntagImage() method to pkg/storage/ImageServer, which will check if the passed-in NameOrID is a name. If so, it merely removes that name from the image, removing the image only if it was the last name that the image had. If the NameOrID is an image ID, the image is removed, as RemoveImage() does. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
parent
f3b7065bd8
commit
ff7bbb4f0d
4 changed files with 138 additions and 8 deletions
|
@ -40,7 +40,7 @@ func (s *Server) RemoveImage(ctx context.Context, req *pb.RemoveImageRequest) (r
|
|||
}
|
||||
}
|
||||
for _, img := range images {
|
||||
err = s.StorageImageServer().RemoveImage(s.ImageContext(), img)
|
||||
err = s.StorageImageServer().UntagImage(s.ImageContext(), img)
|
||||
if err != nil {
|
||||
logrus.Debugf("error deleting image %s: %v", img, err)
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue