Merge pull request #10119 from rhatdan/timeout

Add podman run --timeout option
This commit is contained in:
OpenShift Merge Robot
2021-04-27 16:47:32 -04:00
committed by GitHub
17 changed files with 92 additions and 6 deletions

View File

@ -769,6 +769,19 @@ func WithStopTimeout(timeout uint) CtrCreateOption {
}
}
// WithTimeout sets the maximum time a container is allowed to run"
func WithTimeout(timeout uint) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return define.ErrCtrFinalized
}
ctr.config.Timeout = timeout
return nil
}
}
// WithIDMappings sets the idmappings for the container
func WithIDMappings(idmappings storage.IDMappingOptions) CtrCreateOption {
return func(ctr *Container) error {