summaryrefslogtreecommitdiff
path: root/pkg/network/files.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-01-28 16:13:57 -0600
committerBrent Baude <bbaude@redhat.com>2020-01-28 16:21:59 -0600
commitdce5b6176cfbc57d3da31ef817ad9153a31d64d0 (patch)
tree7615a33129d4cfa81278ae37218ead48a154893c /pkg/network/files.go
parent63b1656f4c91675dce79fbf6e02018659a0badc1 (diff)
downloadpodman-dce5b6176cfbc57d3da31ef817ad9153a31d64d0.tar.gz
podman-dce5b6176cfbc57d3da31ef817ad9153a31d64d0.tar.bz2
podman-dce5b6176cfbc57d3da31ef817ad9153a31d64d0.zip
display file name of bad cni conf
if one of the cni conf files is badly formatted or cannot be loaded, we now display the error as well as the filename. Fixes: #2909 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/network/files.go')
-rw-r--r--pkg/network/files.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/network/files.go b/pkg/network/files.go
index 92cadcf0c..116189c43 100644
--- a/pkg/network/files.go
+++ b/pkg/network/files.go
@@ -24,7 +24,7 @@ func LoadCNIConfsFromDir(dir string) ([]*libcni.NetworkConfigList, error) {
for _, confFile := range files {
conf, err := libcni.ConfListFromFile(confFile)
if err != nil {
- return nil, err
+ return nil, errors.Wrapf(err, "in %s", confFile)
}
configs = append(configs, conf)
}
@@ -41,7 +41,7 @@ func GetCNIConfigPathByName(name string) (string, error) {
for _, confFile := range files {
conf, err := libcni.ConfListFromFile(confFile)
if err != nil {
- return "", err
+ return "", errors.Wrapf(err, "in %s", confFile)
}
if conf.Name == name {
return confFile, nil