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

@ -1194,9 +1194,11 @@ func (r *Runtime) reloadStorageConf() error {
return nil
}
// getVolumePlugin gets a specific volume plugin given its name.
func (r *Runtime) getVolumePlugin(name string) (*plugin.VolumePlugin, error) {
// getVolumePlugin gets a specific volume plugin.
func (r *Runtime) getVolumePlugin(volConfig *VolumeConfig) (*plugin.VolumePlugin, error) {
// There is no plugin for local.
name := volConfig.Driver
timeout := volConfig.Timeout
if name == define.VolumeDriverLocal || name == "" {
return nil, nil
}
@ -1206,7 +1208,7 @@ func (r *Runtime) getVolumePlugin(name string) (*plugin.VolumePlugin, error) {
return nil, errors.Wrapf(define.ErrMissingPlugin, "no volume plugin with name %s available", name)
}
return plugin.GetVolumePlugin(name, pluginPath)
return plugin.GetVolumePlugin(name, pluginPath, timeout)
}
// GetSecretsStorageDir returns the directory that the secrets manager should take