summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index a0894c0e3..cbce1f767 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -415,6 +415,19 @@ func WithStopSignal(signal syscall.Signal) CtrCreateOption {
}
}
+// WithStopTimeout sets the time to after initial stop signal is sent to container, before sending the kill signal
+func WithStopTimeout(timeout uint) CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return ErrCtrFinalized
+ }
+
+ ctr.config.StopTimeout = timeout
+
+ return nil
+ }
+}
+
// WithNetNS indicates that the container should be given a new network
// namespace with a minimal configuration
// An optional array of port mappings can be provided