summaryrefslogtreecommitdiff
path: root/pkg/network/network.go
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-08-02 21:08:13 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-08-02 22:21:28 +0800
commit45b100d21ce1ca1843e26366466d09eac2d4add0 (patch)
treea4fbcccc680ba028deacedb9039e8f1de07e5316 /pkg/network/network.go
parentf4d4bd22887e1271c3bf04532596f4c02201022e (diff)
downloadpodman-45b100d21ce1ca1843e26366466d09eac2d4add0.tar.gz
podman-45b100d21ce1ca1843e26366466d09eac2d4add0.tar.bz2
podman-45b100d21ce1ca1843e26366466d09eac2d4add0.zip
API returns 500 in case network is not found instead of 404
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg/network/network.go')
-rw-r--r--pkg/network/network.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/network/network.go b/pkg/network/network.go
index 6c84c8a8a..b24c72f5f 100644
--- a/pkg/network/network.go
+++ b/pkg/network/network.go
@@ -8,6 +8,7 @@ import (
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/plugins/plugins/ipam/host-local/backend/allocator"
"github.com/containers/common/pkg/config"
+ "github.com/containers/podman/v2/libpod/define"
"github.com/containers/podman/v2/pkg/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -200,7 +201,7 @@ func InspectNetwork(config *config.Config, name string) (map[string]interface{},
func Exists(config *config.Config, name string) (bool, error) {
_, err := ReadRawCNIConfByName(config, name)
if err != nil {
- if errors.Cause(err) == ErrNetworkNotFound {
+ if errors.Cause(err) == define.ErrNoSuchNetwork {
return false, nil
}
return false, err