Преглед на файлове

Merge pull request #28184 from Microsoft/jjh/user

Windows: Plumb through user
Victor Vieux преди 8 години
родител
ревизия
f67d4b897a
променени са 3 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 1 0
      daemon/exec_windows.go
  2. 1 0
      libcontainerd/client_windows.go
  3. 1 0
      libcontainerd/container_windows.go

+ 1 - 0
daemon/exec_windows.go

@@ -9,5 +9,6 @@ import (
 func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
 	// Process arguments need to be escaped before sending to OCI.
 	p.Args = escapeArgs(p.Args)
+	p.User.Username = ec.User
 	return nil
 }

+ 1 - 0
libcontainerd/client_windows.go

@@ -301,6 +301,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
 	// Configure the environment for the process
 	createProcessParms.Environment = setupEnvironmentVariables(procToAdd.Env)
 	createProcessParms.CommandLine = strings.Join(procToAdd.Args, " ")
+	createProcessParms.User = procToAdd.User.Username
 
 	logrus.Debugf("libcontainerd: commandLine: %s", createProcessParms.CommandLine)
 

+ 1 - 0
libcontainerd/container_windows.go

@@ -81,6 +81,7 @@ func (ctr *container) start(attachStdio StdioCallback) error {
 	// Configure the environment for the process
 	createProcessParms.Environment = setupEnvironmentVariables(ctr.ociSpec.Process.Env)
 	createProcessParms.CommandLine = strings.Join(ctr.ociSpec.Process.Args, " ")
+	createProcessParms.User = ctr.ociSpec.Process.User.Username
 
 	// Start the command running in the container.
 	newProcess, err := ctr.hcsContainer.CreateProcess(createProcessParms)