summaryrefslogtreecommitdiff
path: root/pkg/domain
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 /pkg/domain
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 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/parse/parse.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go
index 66794e592..4e8c2e508 100644
--- a/pkg/domain/infra/abi/parse/parse.go
+++ b/pkg/domain/infra/abi/parse/parse.go
@@ -78,6 +78,16 @@ func VolumeOptions(opts map[string]string) ([]libpod.VolumeCreateOption, error)
libpodOptions = append(libpodOptions, libpod.WithVolumeDisableQuota())
// set option "NOQUOTA": "true"
volumeOptions["NOQUOTA"] = "true"
+ case "timeout":
+ if len(splitO) != 2 {
+ return nil, errors.Wrapf(define.ErrInvalidArg, "timeout option must provide a valid timeout in seconds")
+ }
+ intTimeout, err := strconv.Atoi(splitO[1])
+ if err != nil {
+ return nil, errors.Wrapf(err, "cannot convert Timeout %s to an integer", splitO[1])
+ }
+ logrus.Debugf("Removing timeout from options and adding WithTimeout for Timeout %d", intTimeout)
+ libpodOptions = append(libpodOptions, libpod.WithVolumeDriverTimeout(intTimeout))
default:
finalVal = append(finalVal, o)
}