From 762148deb6be6925d17bd12f219f7385e1402439 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 15 Mar 2021 10:45:24 +0100 Subject: Split libpod/network package The `libpod/network` package should only be used on the backend and not the client. The client used this package only for two functions so move them into a new `pkg/network` package. This is needed so we can put linux only code into `libpod/network`, see #9710. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger --- libpod/network/netconflist.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libpod/network/netconflist.go') diff --git a/libpod/network/netconflist.go b/libpod/network/netconflist.go index 1a1583587..a45a4109a 100644 --- a/libpod/network/netconflist.go +++ b/libpod/network/netconflist.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/containernetworking/cni/libcni" + "github.com/containers/podman/v3/pkg/network" "github.com/containers/podman/v3/pkg/util" "github.com/pkg/errors" ) @@ -211,7 +212,7 @@ func IfPassesFilter(netconf *libcni.NetworkConfigList, filters map[string][]stri case "plugin": // match one plugin - plugins := GetCNIPlugins(netconf) + plugins := network.GetCNIPlugins(netconf) for _, val := range filterValues { if strings.Contains(plugins, val) { result = true @@ -243,7 +244,7 @@ func IfPassesFilter(netconf *libcni.NetworkConfigList, filters map[string][]stri case "driver": // matches only for the DefaultNetworkDriver for _, filterValue := range filterValues { - plugins := GetCNIPlugins(netconf) + plugins := network.GetCNIPlugins(netconf) if filterValue == DefaultNetworkDriver && strings.Contains(plugins, DefaultNetworkDriver) { result = true @@ -253,7 +254,7 @@ func IfPassesFilter(netconf *libcni.NetworkConfigList, filters map[string][]stri case "id": // matches part of one id for _, filterValue := range filterValues { - if strings.Contains(GetNetworkID(netconf.Name), filterValue) { + if strings.Contains(network.GetNetworkID(netconf.Name), filterValue) { result = true break } -- cgit v1.2.3-54-g00ecf