mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Fix handling of remove of bogus volumes, networks and Pods
In podman containers rm and podman images rm, the commands exit with error code 1 if the object does not exists. This PR implements similar functionality to volumes, networks, and Pods. Similarly if volumes or Networks are in use by other containers, and return exit code 2. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -92,8 +92,8 @@ func RemoveNetwork(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if reports[0].Err != nil {
|
||||
// If the network cannot be found, we return a 404.
|
||||
if errors.Cause(err) == define.ErrNoSuchNetwork {
|
||||
utils.Error(w, "Something went wrong", http.StatusNotFound, err)
|
||||
if errors.Cause(reports[0].Err) == define.ErrNoSuchNetwork {
|
||||
utils.Error(w, "Something went wrong", http.StatusNotFound, reports[0].Err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user