summaryrefslogtreecommitdiff
path: root/libpod/network/cni/network.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-09-27 13:01:48 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-11-15 15:20:47 +0100
commit295d87bb0b028e57dc2739791dee4820fe5fcc48 (patch)
treede3e347beb6dafb6dde8f26bb2b3001d6231d68b /libpod/network/cni/network.go
parent92da8682b3977a6ef57a6f73dde2f2aef6186d19 (diff)
downloadpodman-295d87bb0b028e57dc2739791dee4820fe5fcc48.tar.gz
podman-295d87bb0b028e57dc2739791dee4820fe5fcc48.tar.bz2
podman-295d87bb0b028e57dc2739791dee4820fe5fcc48.zip
podman machine improve port forwarding
This commits adds port forwarding logic directly into podman. The podman-machine cni plugin is no longer needed. The following new features are supported: - works with cni, netavark and slirp4netns - ports can use the hostIP to bind instead of hard coding 0.0.0.0 - gvproxy no longer listens on 0.0.0.0:7777 (requires a new gvproxy version) - support the udp protocol With this we no longer need podman-machine-cni and should remove it from the packaging. There is also a change to make sure we are backwards compatible with old config which include this plugin. Fixes #11528 Fixes #11728 [NO NEW TESTS NEEDED] We have no podman machine test at the moment. Please test this manually on your system. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/cni/network.go')
-rw-r--r--libpod/network/cni/network.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/network/cni/network.go b/libpod/network/cni/network.go
index 3e9cdaa47..41e3e414e 100644
--- a/libpod/network/cni/network.go
+++ b/libpod/network/cni/network.go
@@ -150,6 +150,13 @@ func (n *cniNetwork) loadNetworks() error {
continue
}
+ // podman < v4.0 used the podman-machine cni plugin for podman machine port forwarding
+ // since this is now build into podman we no longer use the plugin
+ // old configs may still contain it so we just remove it here
+ if n.isMachine {
+ conf = removeMachinePlugin(conf)
+ }
+
if _, err := n.cniConf.ValidateNetworkList(context.Background(), conf); err != nil {
logrus.Warnf("Error validating CNI config file %s: %v", file, err)
continue