aboutsummaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-08-02 10:19:58 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-08-02 10:32:45 -0400
commitc0952c73341321b309174a4e83e2e74d509b98a8 (patch)
tree3fb791087398345300156da8fb3f42664422f605 /libpod/options.go
parent0e2a7be0ec825449a1b95bd5df13e2519c67dcb4 (diff)
downloadpodman-c0952c73341321b309174a4e83e2e74d509b98a8.tar.gz
podman-c0952c73341321b309174a4e83e2e74d509b98a8.tar.bz2
podman-c0952c73341321b309174a4e83e2e74d509b98a8.zip
Support size and inode options on builtin volumes
[NO TESTS NEEDED] Since it is difficult to setup xfs quota Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1982164 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
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 {