detect conflict removing volume/image and warn user
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
ca19b7fcc9
commit
c7afc6188b
@ -252,6 +252,10 @@ func (s *composeService) removeImage(ctx context.Context, image string, w progre
|
|||||||
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if errdefs.IsConflict(err) {
|
||||||
|
w.Event(progress.NewEvent(id, progress.Warning, "Resource is still in use"))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if errdefs.IsNotFound(err) {
|
if errdefs.IsNotFound(err) {
|
||||||
w.Event(progress.NewEvent(id, progress.Done, "Warning: No resource found to remove"))
|
w.Event(progress.NewEvent(id, progress.Done, "Warning: No resource found to remove"))
|
||||||
return nil
|
return nil
|
||||||
@ -267,6 +271,10 @@ func (s *composeService) removeVolume(ctx context.Context, id string, w progress
|
|||||||
w.Event(progress.NewEvent(resource, progress.Done, "Removed"))
|
w.Event(progress.NewEvent(resource, progress.Done, "Removed"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if errdefs.IsConflict(err) {
|
||||||
|
w.Event(progress.NewEvent(resource, progress.Warning, "Resource is still in use"))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if errdefs.IsNotFound(err) {
|
if errdefs.IsNotFound(err) {
|
||||||
w.Event(progress.NewEvent(resource, progress.Done, "Warning: No resource found to remove"))
|
w.Event(progress.NewEvent(resource, progress.Done, "Warning: No resource found to remove"))
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user