aboutsummaryrefslogtreecommitdiff
path: root/libpod/volume.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2022-08-23 14:46:43 -0400
committerMatthew Heon <mheon@redhat.com>2022-08-23 15:42:00 -0400
commit0f739355635d5bc4d538cf88009d7af533e7c289 (patch)
tree7dca8da84bb550c6b853b8f126b3248b8b6c58e7 /libpod/volume.go
parent3bcd8047cff076d34887bd3be7ed0e5701a41a02 (diff)
downloadpodman-0f739355635d5bc4d538cf88009d7af533e7c289.tar.gz
podman-0f739355635d5bc4d538cf88009d7af533e7c289.tar.bz2
podman-0f739355635d5bc4d538cf88009d7af533e7c289.zip
Add support for containers.conf volume timeouts
Also, do a general cleanup of all the timeout code. Changes include: - Convert from int to *uint where possible. Timeouts cannot be negative, hence the uint change; and a timeout of 0 is valid, so we need a new way to detect that the user set a timeout (hence, pointer). - Change name in the database to avoid conflicts between new data type and old one. This will cause timeouts set with 4.2.0 to be lost, but considering nobody is using the feature at present (and the lack of validation means we could have invalid, negative timeouts in the DB) this feels safe. - Ensure volume plugin timeouts can only be used with volumes created using a plugin. Timeouts on the local driver are nonsensical. - Remove the existing test, as it did not use a volume plugin. Write a new test that does. The actual plumbing of the containers.conf timeout in is one line in volume_api.go; the remainder are the above-described cleanups. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/volume.go')
-rw-r--r--libpod/volume.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/volume.go b/libpod/volume.go
index 2e8cd77a5..a054e4032 100644
--- a/libpod/volume.go
+++ b/libpod/volume.go
@@ -56,7 +56,7 @@ type VolumeConfig struct {
// quota tracking.
DisableQuota bool `json:"disableQuota,omitempty"`
// Timeout allows users to override the default driver timeout of 5 seconds
- Timeout int
+ Timeout *uint `json:"timeout,omitempty"`
}
// VolumeState holds the volume's mutable state.