summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2021-08-04 11:59:58 +0000
committerGitHub <noreply@github.com>2021-08-04 11:59:58 +0000
commit8aa869e6288997f01ddb7b8daf78e0edb653fc13 (patch)
treee08af5b0d7a759b90dfd35212e6a2835976f76d4 /libpod/options.go
parent96eb3691305fda9c8018387ca6bb3a19af1a3080 (diff)
parentc0952c73341321b309174a4e83e2e74d509b98a8 (diff)
downloadpodman-8aa869e6288997f01ddb7b8daf78e0edb653fc13.tar.gz
podman-8aa869e6288997f01ddb7b8daf78e0edb653fc13.tar.bz2
podman-8aa869e6288997f01ddb7b8daf78e0edb653fc13.zip
Merge pull request #10973 from rhatdan/quota
Support size options on builtin volumes
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 17a36008d..b021b9f50 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1645,6 +1645,32 @@ func WithVolumeUID(uid int) VolumeCreateOption {
}
}
+// WithVolumeSize sets the maximum size of the volume
+func WithVolumeSize(size uint64) VolumeCreateOption {
+ return func(volume *Volume) error {
+ if volume.valid {
+ return define.ErrVolumeFinalized
+ }
+
+ volume.config.Size = size
+
+ return nil
+ }
+}
+
+// WithVolumeInodes sets the maximum inodes of the volume
+func WithVolumeInodes(inodes uint64) VolumeCreateOption {
+ return func(volume *Volume) error {
+ if volume.valid {
+ return define.ErrVolumeFinalized
+ }
+
+ volume.config.Inodes = inodes
+
+ return nil
+ }
+}
+
// WithVolumeGID sets the GID that the volume will be created as.
func WithVolumeGID(gid int) VolumeCreateOption {
return func(volume *Volume) error {