summaryrefslogtreecommitdiff
path: root/cmd/podman/common/create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-27 16:47:32 -0400
committerGitHub <noreply@github.com>2021-04-27 16:47:32 -0400
commitf613a2a8d5778cf088f4d18b69c86b082264a882 (patch)
treebf07f589419a0d25d23125eaeb27f04103b49ca1 /cmd/podman/common/create.go
parentdbc13f3dac4fa4095ae5db86085e5711a701eb7b (diff)
parent3538815c5b2b4c97304e3ea940cee414b0004d2f (diff)
downloadpodman-f613a2a8d5778cf088f4d18b69c86b082264a882.tar.gz
podman-f613a2a8d5778cf088f4d18b69c86b082264a882.tar.bz2
podman-f613a2a8d5778cf088f4d18b69c86b082264a882.zip
Merge pull request #10119 from rhatdan/timeout
Add podman run --timeout option
Diffstat (limited to 'cmd/podman/common/create.go')
-rw-r--r--cmd/podman/common/create.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index d496ae308..c3d00d293 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -651,7 +651,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) {
createFlags.UintVar(
&cf.StopTimeout,
stopTimeoutFlagName, containerConfig.Engine.StopTimeout,
- "Timeout (in seconds) to stop a container. Default is 10",
+ "Timeout (in seconds) that containers stopped by user command have to exit. If exceeded, the container will be forcibly stopped via SIGKILL.",
)
_ = cmd.RegisterFlagCompletionFunc(stopTimeoutFlagName, completion.AutocompleteNone)
@@ -697,6 +697,14 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) {
)
_ = cmd.RegisterFlagCompletionFunc(systemdFlagName, AutocompleteSystemdFlag)
+ timeoutFlagName := "timeout"
+ createFlags.UintVar(
+ &cf.Timeout,
+ timeoutFlagName, 0,
+ "Maximum length of time a container is allowed to run. The container will be killed automatically after the time expires.",
+ )
+ _ = cmd.RegisterFlagCompletionFunc(timeoutFlagName, completion.AutocompleteNone)
+
tmpfsFlagName := "tmpfs"
createFlags.StringArrayVar(
&cf.TmpFS,