diff options
author | zhangguanzhang <zhangguanzhang@qq.com> | 2020-08-02 21:08:13 +0800 |
---|---|---|
committer | zhangguanzhang <zhangguanzhang@qq.com> | 2020-08-02 22:21:28 +0800 |
commit | 45b100d21ce1ca1843e26366466d09eac2d4add0 (patch) | |
tree | a4fbcccc680ba028deacedb9039e8f1de07e5316 /pkg/network/files.go | |
parent | f4d4bd22887e1271c3bf04532596f4c02201022e (diff) | |
download | podman-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/files.go')
-rw-r--r-- | pkg/network/files.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/network/files.go b/pkg/network/files.go index beb3289f3..38ce38b97 100644 --- a/pkg/network/files.go +++ b/pkg/network/files.go @@ -10,6 +10,7 @@ import ( "github.com/containernetworking/cni/libcni" "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/pkg/errors" ) @@ -55,7 +56,7 @@ func GetCNIConfigPathByName(config *config.Config, name string) (string, error) return confFile, nil } } - return "", errors.Wrap(ErrNetworkNotFound, fmt.Sprintf("unable to find network configuration for %s", name)) + return "", errors.Wrap(define.ErrNoSuchNetwork, fmt.Sprintf("unable to find network configuration for %s", name)) } // ReadRawCNIConfByName reads the raw CNI configuration for a CNI |