summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-06-07 13:36:08 -0400
committerMatthew Heon <mheon@redhat.com>2021-06-07 14:14:57 -0400
commit260192670f9128438a39cf3d1de40a3d0bc8e9ee (patch)
tree37a7d87c3e6e2c496dd4493b7f45f15049ff302b /cmd
parentcdf26a3d5677e0372e8892f85a8fd6065d512bcf (diff)
downloadpodman-260192670f9128438a39cf3d1de40a3d0bc8e9ee.tar.gz
podman-260192670f9128438a39cf3d1de40a3d0bc8e9ee.tar.bz2
podman-260192670f9128438a39cf3d1de40a3d0bc8e9ee.zip
Fix compat create with NetworkMode=default
The rework of namespace handling for rootless CNI broke this, as CNI networks were being computed incorrectly. Fix handling of CNI networks for the Compat Create REST API for containers, and add a test so we don't regress again. Fixes #10569 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/create_opts.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 76d7345fc..66778f519 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -249,7 +249,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c
}
// netMode
- nsmode, _, err := specgen.ParseNetworkNamespace(string(cc.HostConfig.NetworkMode), true)
+ nsmode, networks, err := specgen.ParseNetworkNamespace(string(cc.HostConfig.NetworkMode), true)
if err != nil {
return nil, nil, err
}
@@ -322,7 +322,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c
netInfo.Aliases = aliases
netInfo.CNINetworks = cniNetworks
case len(cc.HostConfig.NetworkMode) > 0:
- netInfo.CNINetworks = []string{string(cc.HostConfig.NetworkMode)}
+ netInfo.CNINetworks = networks
}
parsedTmp := make([]string, 0, len(cc.HostConfig.Tmpfs))