diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-29 15:34:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 15:34:37 +0000 |
commit | 63f0bb93f8b51945e37ad04e977d57942f4dd148 (patch) | |
tree | 621c068638bb457f3695407b77bfb5ce7de4f0e5 /cmd | |
parent | 53aa9764c48783814710919f1b78185cd13db35c (diff) | |
parent | b6176d8987a0049a253fd7a70b2cd8e17bd50b53 (diff) | |
download | podman-63f0bb93f8b51945e37ad04e977d57942f4dd148.tar.gz podman-63f0bb93f8b51945e37ad04e977d57942f4dd148.tar.bz2 podman-63f0bb93f8b51945e37ad04e977d57942f4dd148.zip |
Merge pull request #7783 from ashley-cui/slirp
Add support for slirp network for pods
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/pods/create.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index d8d32b930..ac6d83edd 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -141,14 +141,20 @@ func create(cmd *cobra.Command, args []string) error { if err != nil { return err } + parts := strings.SplitN(netInput, ":", 2) + n := specgen.Namespace{} - switch netInput { - case "bridge": + switch { + case netInput == "bridge": n.NSMode = specgen.Bridge - case "host": + case netInput == "host": n.NSMode = specgen.Host - case "slirp4netns": + case netInput == "slirp4netns", strings.HasPrefix(netInput, "slirp4netns:"): n.NSMode = specgen.Slirp + if len(parts) > 1 { + createOptions.Net.NetworkOptions = make(map[string][]string) + createOptions.Net.NetworkOptions[parts[0]] = strings.Split(parts[1], ",") + } default: // Container and NS mode are presently unsupported n.NSMode = specgen.Bridge |