summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-13 15:40:51 -0400
committerGitHub <noreply@github.com>2022-04-13 15:40:51 -0400
commit480bc83b804467086e0878653d87bf51a4791980 (patch)
treeea109883ffd70c59d1c25e989da707cbf0d0e921 /cmd
parentb962fb9f2929cedbacfdaaf1574300acaa1e8a00 (diff)
parent970c8d4724d0a3d24be5736e09dd37c8644c64b1 (diff)
downloadpodman-480bc83b804467086e0878653d87bf51a4791980.tar.gz
podman-480bc83b804467086e0878653d87bf51a4791980.tar.bz2
podman-480bc83b804467086e0878653d87bf51a4791980.zip
Merge pull request #13844 from Luap99/compat-netmode
compat api: use network mode bridge as default
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/create_opts.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 39146f918..7b7626040 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -164,8 +164,13 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c
}
}
- // netMode
- nsmode, networks, netOpts, err := specgen.ParseNetworkFlag([]string{string(cc.HostConfig.NetworkMode)})
+ // special case for NetworkMode, the podman default is slirp4netns for
+ // rootless but for better docker compat we want bridge.
+ netmode := string(cc.HostConfig.NetworkMode)
+ if netmode == "" || netmode == "default" {
+ netmode = "bridge"
+ }
+ nsmode, networks, netOpts, err := specgen.ParseNetworkFlag([]string{netmode})
if err != nil {
return nil, nil, err
}