diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-02-17 16:49:59 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-02-19 11:29:30 -0500 |
commit | 97323808ed57cf52311a80c55339f8927614b7f0 (patch) | |
tree | df628e8025ef95e142e5cab891ab93fcb42b35e5 /pkg/varlinkapi/pods.go | |
parent | 666d8cf1deeba4113a9b03e0bc208b1a14122733 (diff) | |
download | podman-97323808ed57cf52311a80c55339f8927614b7f0.tar.gz podman-97323808ed57cf52311a80c55339f8927614b7f0.tar.bz2 podman-97323808ed57cf52311a80c55339f8927614b7f0.zip |
Add network options to podman pod create
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.
Also enables host networking in `podman play kube`.
Fixes #2808
Fixes #3837
Fixes #4432
Fixes #4718
Fixes #4770
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/varlinkapi/pods.go')
-rw-r--r-- | pkg/varlinkapi/pods.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/varlinkapi/pods.go b/pkg/varlinkapi/pods.go index 1ebe5d424..2ec45f7a1 100644 --- a/pkg/varlinkapi/pods.go +++ b/pkg/varlinkapi/pods.go @@ -16,6 +16,14 @@ import ( // CreatePod ... func (i *LibpodAPI) CreatePod(call iopodman.VarlinkCall, create iopodman.PodCreate) error { var options []libpod.PodCreateOption + if create.Infra { + options = append(options, libpod.WithInfraContainer()) + nsOptions, err := shared.GetNamespaceOptions(create.Share) + if err != nil { + return err + } + options = append(options, nsOptions...) + } if create.CgroupParent != "" { options = append(options, libpod.WithPodCgroupParent(create.CgroupParent)) } @@ -43,14 +51,6 @@ func (i *LibpodAPI) CreatePod(call iopodman.VarlinkCall, create iopodman.PodCrea options = append(options, libpod.WithInfraContainerPorts(portBindings)) } - if create.Infra { - options = append(options, libpod.WithInfraContainer()) - nsOptions, err := shared.GetNamespaceOptions(create.Share) - if err != nil { - return err - } - options = append(options, nsOptions...) - } options = append(options, libpod.WithPodCgroups()) pod, err := i.Runtime.NewPod(getContext(), options...) |