mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
Merge pull request #10119 from rhatdan/timeout
Add podman run --timeout option
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user