summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-20 08:53:21 -0800
committerGitHub <noreply@github.com>2018-11-20 08:53:21 -0800
commitfe4f09493f41f675d24c969d1b60d1a6a45ddb9e (patch)
tree723bc55fce645c86c9ecaf8aa1eadde46333af2c /libpod/options.go
parent21a76077d36a7d2a79bf4e18b6d3afcb717b102a (diff)
parent690c52a113124efcedccb84e44198e7602f064ec (diff)
downloadpodman-fe4f09493f41f675d24c969d1b60d1a6a45ddb9e.tar.gz
podman-fe4f09493f41f675d24c969d1b60d1a6a45ddb9e.tar.bz2
podman-fe4f09493f41f675d24c969d1b60d1a6a45ddb9e.zip
Merge pull request #1829 from baude/enableportbindinginpods
Allow users to expose ports from the pod to the host
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 8d044313b..507847d65 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1295,3 +1295,14 @@ func WithInfraContainer() PodCreateOption {
return nil
}
}
+
+// WithInfraContainerPorts tells the pod to add port bindings to the pause container
+func WithInfraContainerPorts(bindings []ocicni.PortMapping) PodCreateOption {
+ return func(pod *Pod) error {
+ if pod.valid {
+ return ErrPodFinalized
+ }
+ pod.config.InfraContainer.PortBindings = bindings
+ return nil
+ }
+}