summaryrefslogtreecommitdiff
path: root/pkg/network
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-10 21:28:05 +0100
committerGitHub <noreply@github.com>2020-01-10 21:28:05 +0100
commite1ffac6cc73eb36640cbaf6a1a28ba44749a96d9 (patch)
tree61134dad4b2efdaa65dee6e7206e5ce20080302c /pkg/network
parent6ed88e047579bd2d1eac99a6089cc617f0c4773d (diff)
parent986feef2e80cfaed7cbce0df4fd5d619bcffefd7 (diff)
downloadpodman-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.go5
-rw-r--r--pkg/network/files.go3
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