Browse code

Merge pull request #26578 from Microsoft/jjh/ociuser

Windows: Unify OCI user struct

Brian Goff authored on 2016/09/18 22:20:45
Showing 2 changed files
... ...
@@ -72,7 +72,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e
72 72
 	s.Process.Env = c.CreateDaemonEnvironment(linkedEnv)
73 73
 	s.Process.InitialConsoleSize = c.HostConfig.ConsoleSize
74 74
 	s.Process.Terminal = c.Config.Tty
75
-	s.Process.User.User = c.Config.User
75
+	s.Process.User.Username = c.Config.User
76 76
 
77 77
 	// In spec.Root
78 78
 	s.Root.Path = c.BaseFS
... ...
@@ -66,9 +66,16 @@ type Process struct {
66 66
 	Cwd string `json:"cwd"`
67 67
 }
68 68
 
69
-// User contains the user information for Windows
69
+// User specifies specific user (and group) information for the container process.
70 70
 type User struct {
71
-	User string `json:"user,omitempty"`
71
+	// UID is the user id.
72
+	UID uint32 `json:"uid" platform:"linux,solaris"`
73
+	// GID is the group id.
74
+	GID uint32 `json:"gid" platform:"linux,solaris"`
75
+	// AdditionalGids are additional group ids set for the container's process.
76
+	AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"`
77
+	// Username is the user name.
78
+	Username string `json:"username,omitempty" platform:"windows"`
72 79
 }
73 80
 
74 81
 // Root contains information about the container's root filesystem on the host.