From a9e9fd4f5b56f0dd91944b86feba9a2d3814d93e Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 31 May 2018 17:28:39 -0400 Subject: If user specifies UIDMapSlice without GIDMapSlice, set them equal We need to map slices set for both UID and GID maps to be equivalent if not specified by user. Currently if you do not specify both the containers are not running. Signed-off-by: Daniel J Walsh Closes: #865 Approved by: baude --- pkg/util/utils.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/util/utils.go b/pkg/util/utils.go index a29a1ee60..56a57c15a 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -136,6 +136,13 @@ func ParseIDMapping(UIDMapSlice, GIDMapSlice []string, subUIDMap, subGIDMap stri if subUIDMap == "" && subGIDMap != "" { subUIDMap = subGIDMap } + if len(GIDMapSlice) == 0 && len(UIDMapSlice) != 0 { + GIDMapSlice = UIDMapSlice + } + if len(UIDMapSlice) == 0 && len(GIDMapSlice) != 0 { + UIDMapSlice = GIDMapSlice + } + parseTriple := func(spec []string) (container, host, size int, err error) { cid, err := strconv.ParseUint(spec[0], 10, 32) if err != nil { -- cgit v1.2.3-54-g00ecf