diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2021-08-04 11:59:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 11:59:58 +0000 |
commit | 8aa869e6288997f01ddb7b8daf78e0edb653fc13 (patch) | |
tree | e08af5b0d7a759b90dfd35212e6a2835976f76d4 /libpod/options.go | |
parent | 96eb3691305fda9c8018387ca6bb3a19af1a3080 (diff) | |
parent | c0952c73341321b309174a4e83e2e74d509b98a8 (diff) | |
download | podman-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.go | 26 |
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 { |