summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-05-31 17:28:39 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-31 22:30:16 +0000
commita9e9fd4f5b56f0dd91944b86feba9a2d3814d93e (patch)
tree19058ee290df99cdf87296ed350a5d9462f00d9b
parent0eda60957d593411a144371bb4903c7a74307a59 (diff)
downloadpodman-a9e9fd4f5b56f0dd91944b86feba9a2d3814d93e.tar.gz
podman-a9e9fd4f5b56f0dd91944b86feba9a2d3814d93e.tar.bz2
podman-a9e9fd4f5b56f0dd91944b86feba9a2d3814d93e.zip
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 <dwalsh@redhat.com> Closes: #865 Approved by: baude
-rw-r--r--pkg/util/utils.go7
1 files changed, 7 insertions, 0 deletions
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 {