diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-24 09:35:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 09:35:57 -0400 |
commit | 0f92cf22a69876975ca6ad97a08751bf2008e257 (patch) | |
tree | c2d7c6316570b0d4e20350f8152e9b08ef66a36e /pkg/domain | |
parent | 67c4068bb35fd1aad95b1701c94ed11183d0fd66 (diff) | |
parent | 0f739355635d5bc4d538cf88009d7af533e7c289 (diff) | |
download | podman-0f92cf22a69876975ca6ad97a08751bf2008e257.tar.gz podman-0f92cf22a69876975ca6ad97a08751bf2008e257.tar.bz2 podman-0f92cf22a69876975ca6ad97a08751bf2008e257.zip |
Merge pull request #15437 from mheon/default_volume_timeout
Add support for containers.conf volume timeouts
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/parse/parse.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go index 19699589b..fb2876bb2 100644 --- a/pkg/domain/infra/abi/parse/parse.go +++ b/pkg/domain/infra/abi/parse/parse.go @@ -86,8 +86,11 @@ func VolumeOptions(opts map[string]string) ([]libpod.VolumeCreateOption, error) if err != nil { return nil, fmt.Errorf("cannot convert Timeout %s to an integer: %w", splitO[1], err) } + if intTimeout < 0 { + return nil, fmt.Errorf("volume timeout cannot be negative (got %d)", intTimeout) + } logrus.Debugf("Removing timeout from options and adding WithTimeout for Timeout %d", intTimeout) - libpodOptions = append(libpodOptions, libpod.WithVolumeDriverTimeout(intTimeout)) + libpodOptions = append(libpodOptions, libpod.WithVolumeDriverTimeout(uint(intTimeout))) default: finalVal = append(finalVal, o) } |