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>
This commit is contained in:
cdoern
2022-06-01 16:02:39 -04:00
parent f808907d85
commit 7b3e43c1f6
12 changed files with 60 additions and 9 deletions

View File

@ -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 {