summaryrefslogtreecommitdiff
path: root/pkg/network/files.go
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-08-02 21:08:13 +0800
committerValentin Rothberg <rothberg@redhat.com>2020-08-11 13:53:23 +0200
commit8931e99a18cc168ebee07bb72b62849815af7434 (patch)
tree9ed8bf6344ae3c6e3d629f94b868997c34398bb3 /pkg/network/files.go
parentc24c64e89e8a32b4fa24385aa540ee00f5d0c991 (diff)
downloadpodman-8931e99a18cc168ebee07bb72b62849815af7434.tar.gz
podman-8931e99a18cc168ebee07bb72b62849815af7434.tar.bz2
podman-8931e99a18cc168ebee07bb72b62849815af7434.zip
API returns 500 in case network is not found instead of 404
Backported-by: Valentin Rothberg <rothberg@redhat.com> Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg/network/files.go')
-rw-r--r--pkg/network/files.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/network/files.go b/pkg/network/files.go
index beb3289f3..f174a762c 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/libpod/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