mirror of https://github.com/docker/cli.git
Set default values for uid and gid to prevent errors when starting a service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
b0eabe7718
commit
485a2b2b2f
|
@ -196,11 +196,20 @@ func convertServiceSecrets(
|
||||||
source = secretSpec.External.Name
|
source = secretSpec.External.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uid := secret.UID
|
||||||
|
gid := secret.GID
|
||||||
|
if uid == "" {
|
||||||
|
uid = "0"
|
||||||
|
}
|
||||||
|
if gid == "" {
|
||||||
|
gid = "0"
|
||||||
|
}
|
||||||
|
|
||||||
opts = append(opts, &types.SecretRequestOption{
|
opts = append(opts, &types.SecretRequestOption{
|
||||||
Source: source,
|
Source: source,
|
||||||
Target: target,
|
Target: target,
|
||||||
UID: secret.UID,
|
UID: uid,
|
||||||
GID: secret.GID,
|
GID: gid,
|
||||||
Mode: os.FileMode(secret.Mode),
|
Mode: os.FileMode(secret.Mode),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue