summaryrefslogtreecommitdiff
path: root/pkg/specgenutil
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-10-15 13:14:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-10-18 14:44:10 -0400
commit087f8fc73bec664a30dcf0757cd3cb44ea150582 (patch)
treeb2a04eb4de47d044c6644dcc2da366935a0f9214 /pkg/specgenutil
parente0ffc431fe7f016124fdcb36819698a90fe448a9 (diff)
downloadpodman-087f8fc73bec664a30dcf0757cd3cb44ea150582.tar.gz
podman-087f8fc73bec664a30dcf0757cd3cb44ea150582.tar.bz2
podman-087f8fc73bec664a30dcf0757cd3cb44ea150582.zip
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 <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgenutil')
-rw-r--r--pkg/specgenutil/specgen.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 6a6397257..7636ea103 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -392,6 +392,17 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
}
s.Annotations = annotations
+ if len(c.StorageOpts) > 0 {
+ opts := make(map[string]string, len(c.StorageOpts))
+ for _, opt := range c.StorageOpts {
+ split := strings.SplitN(opt, "=", 2)
+ if len(split) != 2 {
+ return errors.Errorf("storage-opt must be formatted KEY=VALUE")
+ }
+ opts[split[0]] = split[1]
+ }
+ s.StorageOpts = opts
+ }
s.WorkDir = c.Workdir
if c.Entrypoint != nil {
entrypoint := []string{}