Merge pull request #146 from zhangzhenhao/master
add the user id support of runAsUser
This commit is contained in:
commit
b27ee85f74
@ -21,7 +21,7 @@ source $(dirname "${BASH_SOURCE[0]}")/test-utils.sh
|
|||||||
# FOCUS focuses the test to run.
|
# FOCUS focuses the test to run.
|
||||||
FOCUS=${FOCUS:-}
|
FOCUS=${FOCUS:-}
|
||||||
# SKIP skips the test to skip.
|
# SKIP skips the test to skip.
|
||||||
SKIP=${SKIP:-"RunAsUser"}
|
SKIP=${SKIP:-"RunAsUserName"}
|
||||||
REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"}
|
REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"}
|
||||||
|
|
||||||
if [[ -z "${GOPATH}" ]]; then
|
if [[ -z "${GOPATH}" ]]; then
|
||||||
|
@ -261,7 +261,11 @@ func (c *criContainerdService) generateContainerSpec(id string, sandboxPid uint3
|
|||||||
// Set namespaces, share namespace with sandbox container.
|
// Set namespaces, share namespace with sandbox container.
|
||||||
setOCINamespaces(&g, securityContext.GetNamespaceOptions(), sandboxPid)
|
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()
|
supplementalGroups := securityContext.GetSupplementalGroups()
|
||||||
for _, group := range supplementalGroups {
|
for _, group := range supplementalGroups {
|
||||||
|
Loading…
Reference in New Issue
Block a user