From 087f8fc73bec664a30dcf0757cd3cb44ea150582 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 15 Oct 2021 13:14:39 -0400 Subject: Allow API to specify size and inode quota Fixes: https://github.com/containers/podman/issues/11016 [NO NEW TESTS NEEDED] We have no easy way to tests this in CI/CD systems. Requires quota to be setup on directories to work. Fixes: https://github.com/containers/podman/issues/11016 Signed-off-by: Daniel J Walsh --- libpod/container_internal.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpod/container_internal.go') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 4e8074840..a7315dd55 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -443,6 +443,18 @@ func (c *Container) setupStorage(ctx context.Context) error { }, LabelOpts: c.config.LabelOpts, } + + nopts := len(c.config.StorageOpts) + if nopts > 0 { + options.StorageOpt = make(map[string]string, nopts) + for _, opt := range c.config.StorageOpts { + split2 := strings.SplitN(opt, "=", 2) + if len(split2) > 2 { + return errors.Wrapf(define.ErrInvalidArg, "invalid storage options %q for %s", opt, c.ID()) + } + options.StorageOpt[split2[0]] = split2[1] + } + } if c.restoreFromCheckpoint && !c.config.Privileged { // If restoring from a checkpoint, the root file-system // needs to be mounted with the same SELinux labels as -- cgit v1.2.3-54-g00ecf