diff options
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 |