From e682378169700b196acd9b5edb5192953c853c5f Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 4 Oct 2021 15:40:53 -0400 Subject: [PATCH] Allow setting quota for individual containers Drivers have the ability to support size and inodes quota, but we don't allow these options to be passed down to the driver. With this fix, Podman should be able to support --storage-opt size= per container. Helps Fix: https://github.com/containers/podman/issues/11016 Signed-off-by: Daniel J Walsh --- store.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/store.go b/store.go index 169c7d1513..c5a4bcd729 100644 --- a/store.go +++ b/store.go @@ -13,9 +13,8 @@ import ( "time" // register all of the built-in drivers - _ "github.com/containers/storage/drivers/register" - drivers "github.com/containers/storage/drivers" + _ "github.com/containers/storage/drivers/register" "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/directory" "github.com/containers/storage/pkg/idtools" @@ -575,10 +574,11 @@ type ContainerOptions struct { // container's layer will inherit settings from the image's top layer // or, if it is not being created based on an image, the Store object. types.IDMappingOptions - LabelOpts []string - Flags map[string]interface{} - MountOpts []string - Volatile bool + LabelOpts []string + Flags map[string]interface{} + MountOpts []string + Volatile bool + StorageOpt map[string]string } type store struct { @@ -1384,7 +1384,7 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat options.Flags["MountLabel"] = mountLabel } - clayer, err := rlstore.Create(layer, imageTopLayer, nil, options.Flags["MountLabel"].(string), nil, layerOptions, true) + clayer, err := rlstore.Create(layer, imageTopLayer, nil, options.Flags["MountLabel"].(string), options.StorageOpt, layerOptions, true) if err != nil { return nil, err }