Return ErrNotFound when deleting a non-exist image.
Signed-off-by: Random-Liu <lantaol@google.com>
This commit is contained in:
parent
bbeaab5ee3
commit
c163673ba3
@ -134,7 +134,11 @@ func (s *storage) List(ctx context.Context) ([]Image, error) {
|
||||
|
||||
func (s *storage) Delete(ctx context.Context, name string) error {
|
||||
return withImagesBucket(s.tx, func(bkt *bolt.Bucket) error {
|
||||
return bkt.DeleteBucket([]byte(name))
|
||||
err := bkt.DeleteBucket([]byte(name))
|
||||
if err == bolt.ErrBucketNotFound {
|
||||
return ErrNotFound
|
||||
}
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user