diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-13 14:07:05 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-09-15 20:00:28 +0200 |
commit | 5e8309464aea005fbc1604c304a94760aff4ee9a (patch) | |
tree | cba4282b3706c51107f37c7d0dec5f26df32286e /libpod/network | |
parent | 1bcd006c5fffe41a36cc6fdc17623a90693f3cab (diff) | |
download | podman-5e8309464aea005fbc1604c304a94760aff4ee9a.tar.gz podman-5e8309464aea005fbc1604c304a94760aff4ee9a.tar.bz2 podman-5e8309464aea005fbc1604c304a94760aff4ee9a.zip |
Add Drivers method to the Network Interface
Drivers should return the list of supported network drivers by this
plugin. This is useful for podman info.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network')
-rw-r--r-- | libpod/network/cni/network.go | 6 | ||||
-rw-r--r-- | libpod/network/types/network.go | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libpod/network/cni/network.go b/libpod/network/cni/network.go index 4e4ea7ee5..46e07f780 100644 --- a/libpod/network/cni/network.go +++ b/libpod/network/cni/network.go @@ -106,6 +106,12 @@ func NewCNINetworkInterface(conf InitConfig) (types.ContainerNetwork, error) { return n, nil } +// Drivers will return the list of supported network drivers +// for this interface. +func (n *cniNetwork) Drivers() []string { + return []string{types.BridgeNetworkDriver, types.MacVLANNetworkDriver} +} + func (n *cniNetwork) loadNetworks() error { // skip loading networks if they are already loaded if n.networks != nil { diff --git a/libpod/network/types/network.go b/libpod/network/types/network.go index ad46c9ac1..6053ceb29 100644 --- a/libpod/network/types/network.go +++ b/libpod/network/types/network.go @@ -23,6 +23,10 @@ type ContainerNetwork interface { Setup(namespacePath string, options SetupOptions) (map[string]StatusBlock, error) // Teardown will teardown the container network namespace. Teardown(namespacePath string, options TeardownOptions) error + + // Drivers will return the list of supported network drivers + // for this interface. + Drivers() []string } // Network describes the Network attributes. |