Add synchronous image delete
Synchronous image delete provides an option image delete to wait until the next garbage collection deletes after an image is removed before returning success to the caller. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -74,9 +74,16 @@ func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpath
|
||||
return imageFromProto(&updated.Image), nil
|
||||
}
|
||||
|
||||
func (s *remoteImages) Delete(ctx context.Context, name string) error {
|
||||
func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error {
|
||||
var do images.DeleteOptions
|
||||
for _, opt := range opts {
|
||||
if err := opt(ctx, &do); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
_, err := s.client.Delete(ctx, &imagesapi.DeleteImageRequest{
|
||||
Name: name,
|
||||
Sync: do.Synchronous,
|
||||
})
|
||||
|
||||
return errdefs.FromGRPC(err)
|
||||
|
||||
Reference in New Issue
Block a user