mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
Add podman run --timeout option
This option allows users to specify the maximum amount of time to run before conmon sends the kill signal to the container. Fixes: https://github.com/containers/podman/issues/6412 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@@ -292,6 +292,9 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
|
||||
if s.StopTimeout != nil {
|
||||
options = append(options, libpod.WithStopTimeout(*s.StopTimeout))
|
||||
}
|
||||
if s.Timeout != 0 {
|
||||
options = append(options, libpod.WithTimeout(s.Timeout))
|
||||
}
|
||||
if s.LogConfiguration != nil {
|
||||
if len(s.LogConfiguration.Path) > 0 {
|
||||
options = append(options, libpod.WithLogPath(s.LogConfiguration.Path))
|
||||
|
||||
@@ -83,6 +83,11 @@ type ContainerBasicConfig struct {
|
||||
// instead.
|
||||
// Optional.
|
||||
StopTimeout *uint `json:"stop_timeout,omitempty"`
|
||||
// Timeout is a maximum time in seconds the container will run before
|
||||
// main process is sent SIGKILL.
|
||||
// If 0 is used, signal will not be sent. Container can run indefinitely
|
||||
// Optional.
|
||||
Timeout uint `json:"timeout,omitempty"`
|
||||
// LogConfiguration describes the logging for a container including
|
||||
// driver, path, and options.
|
||||
// Optional
|
||||
|
||||
Reference in New Issue
Block a user