summaryrefslogtreecommitdiff
path: root/pkg/network/devices.go
diff options
context:
space:
mode:
authorMaximilian Müller <maxm123@techie.com>2020-05-13 18:52:58 +0200
committerMaximilian Müller <maxm123@techie.com>2020-05-14 22:15:32 +0200
commit48d83482db11d1ea3432520035cc457dc659c9a9 (patch)
tree2dfdf848678eefef1a968c000a6a273c542a83c2 /pkg/network/devices.go
parent0d9625152b9acf1dc7662e38f56aa5b106c4dfcd (diff)
downloadpodman-48d83482db11d1ea3432520035cc457dc659c9a9.tar.gz
podman-48d83482db11d1ea3432520035cc457dc659c9a9.tar.bz2
podman-48d83482db11d1ea3432520035cc457dc659c9a9.zip
Use the libpod.conf cni_config_dir option for inspect and delete
The pkg/network/files.go methods currently use the constant '/etc/cni/net.d' for network handling. This results in the unability of podman-network-inspect and podman-network-rm to locate the cni network configuration files. This commit propagates the libpod.Runtime through the networking methods and finally makes use of its configuration (config.Network.NetworkConfigDir). Closes #6212 Signed-off-by: Maximilian Müller <maxm123@techie.com>
Diffstat (limited to 'pkg/network/devices.go')
-rw-r--r--pkg/network/devices.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/network/devices.go b/pkg/network/devices.go
index 78e1a5aa5..8eac32142 100644
--- a/pkg/network/devices.go
+++ b/pkg/network/devices.go
@@ -4,6 +4,7 @@ import (
"fmt"
"os/exec"
+ "github.com/containers/common/pkg/config"
"github.com/containers/libpod/pkg/util"
"github.com/containers/libpod/utils"
"github.com/sirupsen/logrus"
@@ -11,12 +12,12 @@ import (
// GetFreeDeviceName returns a device name that is unused; used when no network
// name is provided by user
-func GetFreeDeviceName() (string, error) {
+func GetFreeDeviceName(config *config.Config) (string, error) {
var (
deviceNum uint
deviceName string
)
- networkNames, err := GetNetworkNamesFromFileSystem()
+ networkNames, err := GetNetworkNamesFromFileSystem(config)
if err != nil {
return "", err
}
@@ -24,7 +25,7 @@ func GetFreeDeviceName() (string, error) {
if err != nil {
return "", err
}
- bridgeNames, err := GetBridgeNamesFromFileSystem()
+ bridgeNames, err := GetBridgeNamesFromFileSystem(config)
if err != nil {
return "", err
}