Skip to content

Commit

Permalink
display file name of bad cni conf
Browse files Browse the repository at this point in the history
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: containers#2909
Signed-off-by: Brent Baude <[email protected]>
  • Loading branch information
baude committed Jan 28, 2020
1 parent 63b1656 commit dce5b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/network/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit dce5b61

Please sign in to comment.