From 167b3f95b7f659817f8421742ca4078edd42dbaa Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 26 Jan 2017 12:00:46 -0500 Subject: [PATCH] Set default values for uid and gid to prevent errors when starting a service. Signed-off-by: Daniel Nephin --- cli/compose/convert/service.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index 573f7723fd..f23df26127 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -196,11 +196,20 @@ func convertServiceSecrets( source = secretSpec.External.Name } + uid := secret.UID + gid := secret.GID + if uid == "" { + uid = "0" + } + if gid == "" { + gid = "0" + } + opts = append(opts, &types.SecretRequestOption{ Source: source, Target: target, - UID: secret.UID, - GID: secret.GID, + UID: uid, + GID: gid, Mode: os.FileMode(secret.Mode), }) }