add the user id support of runAsUser

Signed-off-by: zhangzhenhao <zhangzhenhao@outlook.com>
This commit is contained in:
zhangzhenhao
2017-08-24 23:29:45 +08:00
parent 2faa665eb2
commit 331e542c09
2 changed files with 6 additions and 2 deletions

View File

@@ -261,7 +261,11 @@ func (c *criContainerdService) generateContainerSpec(id string, sandboxPid uint3
// Set namespaces, share namespace with sandbox container.
setOCINamespaces(&g, securityContext.GetNamespaceOptions(), sandboxPid)
// TODO(random-liu): [P1] Set user/username.
// TODO(random-liu): [P1] Set username.
runAsUser := securityContext.GetRunAsUser()
if runAsUser != nil {
g.SetProcessUID(uint32(runAsUser.GetValue()))
}
supplementalGroups := securityContext.GetSupplementalGroups()
for _, group := range supplementalGroups {