From 22474095abe39c14c902650b08002c0bc89e7e6a Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 29 Sep 2020 10:05:53 -0400 Subject: 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 --- libpod/define/errors.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libpod/define') diff --git a/libpod/define/errors.go b/libpod/define/errors.go index b3f6483d1..627928ef7 100644 --- a/libpod/define/errors.go +++ b/libpod/define/errors.go @@ -162,6 +162,9 @@ var ( // in a pod. This cannot be done as the infra container has all the network information ErrNetworkOnPodContainer = errors.New("network cannot be configured when it is shared with a pod") + // ErrNetworkInUse indicates the requested operation failed because the network was in use + ErrNetworkInUse = errors.New("network is being used") + // ErrStoreNotInitialized indicates that the container storage was never // initialized. ErrStoreNotInitialized = errors.New("the container storage was never initialized") -- cgit v1.2.3-54-g00ecf