1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Set default values for uid and gid to prevent errors when starting a service.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 167b3f95b7)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Daniel Nephin 2017-01-26 12:00:46 -05:00 committed by Victor Vieux
parent c19f50acef
commit 1afa22733c

View file

@ -211,11 +211,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),
})
}