diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-10 21:28:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 21:28:05 +0100 |
commit | e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9 (patch) | |
tree | 61134dad4b2efdaa65dee6e7206e5ce20080302c /pkg/network | |
parent | 6ed88e047579bd2d1eac99a6089cc617f0c4773d (diff) | |
parent | 986feef2e80cfaed7cbce0df4fd5d619bcffefd7 (diff) | |
download | podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.gz podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.bz2 podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.zip |
Merge pull request #4832 from baude/apiv2tomaster
Apiv2tomaster
Diffstat (limited to 'pkg/network')
-rw-r--r-- | pkg/network/config.go | 5 | ||||
-rw-r--r-- | pkg/network/files.go | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/pkg/network/config.go b/pkg/network/config.go index a41455f68..e5c981419 100644 --- a/pkg/network/config.go +++ b/pkg/network/config.go @@ -2,6 +2,7 @@ package network import ( "encoding/json" + "errors" "net" ) @@ -19,6 +20,10 @@ const ( DefaultPodmanDomainName = "dns.podman" ) +var ( + ErrNetworkNotFound = errors.New("network not found") +) + // GetDefaultPodmanNetwork outputs the default network for podman func GetDefaultPodmanNetwork() (*net.IPNet, error) { _, n, err := net.ParseCIDR("10.88.1.0/24") diff --git a/pkg/network/files.go b/pkg/network/files.go index 2f3932974..92cadcf0c 100644 --- a/pkg/network/files.go +++ b/pkg/network/files.go @@ -2,6 +2,7 @@ package network import ( "encoding/json" + "fmt" "io/ioutil" "sort" "strings" @@ -46,7 +47,7 @@ func GetCNIConfigPathByName(name string) (string, error) { return confFile, nil } } - return "", errors.Errorf("unable to find network configuration for %s", name) + return "", errors.Wrap(ErrNetworkNotFound, fmt.Sprintf("unable to find network configuration for %s", name)) } // ReadRawCNIConfByName reads the raw CNI configuration for a CNI |