summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-09-07 18:24:22 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-08 10:09:28 +0200
commitf18ccbcc0f70c23a6b854130395d9a940383290b (patch)
tree9cbb69f94e1c7ef738c07aee8a0ed2bf6f45f0ef /pkg/domain/infra/abi
parent8a55363b80a012b6c6e774957ac477d0fd540a5e (diff)
downloadpodman-f18ccbcc0f70c23a6b854130395d9a940383290b.tar.gz
podman-f18ccbcc0f70c23a6b854130395d9a940383290b.tar.bz2
podman-f18ccbcc0f70c23a6b854130395d9a940383290b.zip
fix play kube --network options
Commit 092902b45555 introduced advanced network options for podman play kube. However this never worked because it unconditionally set the network mode to bridge after it parsed the network option. Added a test to ensure the correct mode is set. Truly fixes #10807 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r--pkg/domain/infra/abi/play.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 2799df794..c9a6930f7 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -196,9 +196,11 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
if (ns.IsBridge() && len(cniNets) == 0) || ns.IsHost() {
return nil, errors.Errorf("invalid value passed to --network: bridge or host networking must be configured in YAML")
}
- logrus.Debugf("Pod %q joining CNI networks: %v", podName, cniNets)
- podOpt.Net.Network.NSMode = specgen.Bridge
- podOpt.Net.CNINetworks = append(podOpt.Net.CNINetworks, cniNets...)
+
+ podOpt.Net.Network = ns
+ if len(cniNets) > 0 {
+ podOpt.Net.CNINetworks = append(podOpt.Net.CNINetworks, cniNets...)
+ }
if len(netOpts) > 0 {
podOpt.Net.NetworkOptions = netOpts
}