summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2022-06-01 16:02:39 -0400
committercdoern <cdoern@redhat.com>2022-06-09 16:44:21 -0400
commit7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c (patch)
tree0b460b5067c72f31999399bd3eb83bce8268dfdb /libpod/options.go
parentf808907d85204a2a5606067eb31400aa12233635 (diff)
downloadpodman-7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c.tar.gz
podman-7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c.tar.bz2
podman-7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c.zip
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 <cdoern@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go12
1 files changed, 12 insertions, 0 deletions
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 {