diff options
author | cdoern <cdoern@redhat.com> | 2022-06-01 16:02:39 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2022-06-09 16:44:21 -0400 |
commit | 7b3e43c1f6cf27a1cde96c0f650a793a56cebc4c (patch) | |
tree | 0b460b5067c72f31999399bd3eb83bce8268dfdb /libpod/options.go | |
parent | f808907d85204a2a5606067eb31400aa12233635 (diff) | |
download | podman-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.go | 12 |
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 { |