diff options
author | Qi Wang <qiwan@redhat.com> | 2020-06-16 14:22:05 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2020-06-19 09:40:13 -0400 |
commit | f61a7f25a8a6ec27fec069989f4b19b2ea19fc75 (patch) | |
tree | 6e6065b6a5456c66116ebc5c4bec7395df4bac5c /libpod/options.go | |
parent | 5ec29f8d4e79500915ec79824d9eb21630205f3f (diff) | |
download | podman-f61a7f25a8a6ec27fec069989f4b19b2ea19fc75.tar.gz podman-f61a7f25a8a6ec27fec069989f4b19b2ea19fc75.tar.bz2 podman-f61a7f25a8a6ec27fec069989f4b19b2ea19fc75.zip |
Add --preservefds to podman run
Add --preservefds to podman run. close https://github.com/containers/libpod/issues/6458
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index ffc9c1018..7a60870a0 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1369,6 +1369,18 @@ func WithHealthCheck(healthCheck *manifest.Schema2HealthConfig) CtrCreateOption } } +// WithPreserveFDs forwards from the process running Libpod into the container +// the given number of extra FDs (starting after the standard streams) to the created container +func WithPreserveFDs(fd uint) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrCtrFinalized + } + ctr.config.PreserveFDs = fd + return nil + } +} + // WithCreateCommand adds the full command plus arguments of the current // process to the container config. func WithCreateCommand() CtrCreateOption { |