diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-10 14:00:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 14:00:49 -0400 |
commit | 2f0e803e7605570cd073ddffc8110a6b9d466a17 (patch) | |
tree | a08b56eea43da3fa92f0cb88b48606a9f7f014b4 /pkg/network/files.go | |
parent | 8d78605929fc7251e31aee35fcc166afe03a2a80 (diff) | |
parent | f82abc774a70419bc7a2ff444a323110e1d9d938 (diff) | |
download | podman-2f0e803e7605570cd073ddffc8110a6b9d466a17.tar.gz podman-2f0e803e7605570cd073ddffc8110a6b9d466a17.tar.bz2 podman-2f0e803e7605570cd073ddffc8110a6b9d466a17.zip |
Merge pull request #7460 from AkihiroSuda/allow-rootless-cni
rootless: support `podman network create` (CNI-in-slirp4netns)
Diffstat (limited to 'pkg/network/files.go')
-rw-r--r-- | pkg/network/files.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkg/network/files.go b/pkg/network/files.go index 38ce38b97..a2090491f 100644 --- a/pkg/network/files.go +++ b/pkg/network/files.go @@ -14,11 +14,16 @@ import ( "github.com/pkg/errors" ) -func GetCNIConfDir(config *config.Config) string { - if len(config.Network.NetworkConfigDir) < 1 { - return CNIConfigDir +func GetCNIConfDir(configArg *config.Config) string { + if len(configArg.Network.NetworkConfigDir) < 1 { + dc, err := config.DefaultConfig() + if err != nil { + // Fallback to hard-coded dir + return CNIConfigDir + } + return dc.Network.NetworkConfigDir } - return config.Network.NetworkConfigDir + return configArg.Network.NetworkConfigDir } // LoadCNIConfsFromDir loads all the CNI configurations from a dir |