diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-30 11:33:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 11:33:19 +0000 |
commit | 08d036cbd4225a9802fb8dc7c4da7b53ded3896a (patch) | |
tree | b38e8fa39f94589bfdaf90444d3dfe1dce4b41e8 /pkg/domain | |
parent | 19f080f1af884c1e36f55dc81cd51b0ac91a868a (diff) | |
parent | 22474095abe39c14c902650b08002c0bc89e7e6a (diff) | |
download | podman-08d036cbd4225a9802fb8dc7c4da7b53ded3896a.tar.gz podman-08d036cbd4225a9802fb8dc7c4da7b53ded3896a.tar.bz2 podman-08d036cbd4225a9802fb8dc7c4da7b53ded3896a.zip |
Merge pull request #7825 from rhatdan/exitcode
Fix handling of remove of bogus volumes, networks and Pods
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/network.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index 053be6528..5acfea853 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -12,6 +12,7 @@ import ( "github.com/containernetworking/cni/libcni" cniversion "github.com/containernetworking/cni/pkg/version" "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/podman/v2/pkg/network" "github.com/containers/podman/v2/pkg/util" @@ -85,7 +86,7 @@ func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, o // if user passes force, we nuke containers and pods if !options.Force { // Without the force option, we return an error - return reports, errors.Errorf("%q has associated containers with it. Use -f to forcibly delete containers and pods", name) + return reports, errors.Wrapf(define.ErrNetworkInUse, "%q has associated containers with it. Use -f to forcibly delete containers and pods", name) } if c.IsInfra() { // if we have a infra container we need to remove the pod |