diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-16 16:40:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 16:40:44 -0400 |
commit | 8d7e7954546efb344d677e0c3c86d9d045a3de4f (patch) | |
tree | 387d9f86b2507ab4ec9b5c0f4e77fca39940aa8b /libpod/options.go | |
parent | acf86ef5ab9c5307fe0bdc93bf534decaafe38ae (diff) | |
parent | b3d6383f25e71748793535733a767c60ccfcbd82 (diff) | |
download | podman-8d7e7954546efb344d677e0c3c86d9d045a3de4f.tar.gz podman-8d7e7954546efb344d677e0c3c86d9d045a3de4f.tar.bz2 podman-8d7e7954546efb344d677e0c3c86d9d045a3de4f.zip |
Merge pull request #7621 from rhatdan/pods
Fix podman pod create --infra-command and --infra-image
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index d592124bc..f7b3419e5 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1659,6 +1659,36 @@ func WithUmask(umask string) CtrCreateOption { // Pod Creation Options +// WithInfraImage sets the infra image for libpod. +// An infra image is used for inter-container kernel +// namespace sharing within a pod. Typically, an infra +// container is lightweight and is there to reap +// zombie processes within its pid namespace. +func WithInfraImage(img string) PodCreateOption { + return func(pod *Pod) error { + if pod.valid { + return define.ErrPodFinalized + } + + pod.config.InfraContainer.InfraImage = img + + return nil + } +} + +// WithInfraCommand sets the command to +// run on pause container start up. +func WithInfraCommand(cmd []string) PodCreateOption { + return func(pod *Pod) error { + if pod.valid { + return define.ErrPodFinalized + } + + pod.config.InfraContainer.InfraCommand = cmd + return nil + } +} + // WithPodName sets the name of the pod. func WithPodName(name string) PodCreateOption { return func(pod *Pod) error { |