From 7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c Mon Sep 17 00:00:00 2001 From: cdoern Date: Wed, 1 Jun 2022 16:02:39 -0400 Subject: podman volume create --opt=o=timeout... add an option to configure the driver timeout when creating a volume. The default is 5 seconds but this value is too small for some custom drivers. Signed-off-by: cdoern --- libpod/options.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index 8b3b07efa..7f4ca22d3 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1693,6 +1693,18 @@ func withSetAnon() VolumeCreateOption { } } +// WithVolumeDriverTimeout sets the volume creation timeout period +func WithVolumeDriverTimeout(timeout int) VolumeCreateOption { + return func(volume *Volume) error { + if volume.valid { + return define.ErrVolumeFinalized + } + + volume.config.Timeout = timeout + return nil + } +} + // WithTimezone sets the timezone in the container func WithTimezone(path string) CtrCreateOption { return func(ctr *Container) error { -- cgit v1.2.3-54-g00ecf