From 93f61b85ebe184506a3d99cee3b4ebaac559c712 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 14 Sep 2016 11:46:18 -0700 Subject: [PATCH] Windows: Unify OCI user struct Signed-off-by: John Howard --- daemon/oci_windows.go | 2 +- libcontainerd/windowsoci/oci_windows.go | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/daemon/oci_windows.go b/daemon/oci_windows.go index c93afcf3a4..cb01cb2602 100644 --- a/daemon/oci_windows.go +++ b/daemon/oci_windows.go @@ -72,7 +72,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e s.Process.Env = c.CreateDaemonEnvironment(linkedEnv) s.Process.InitialConsoleSize = c.HostConfig.ConsoleSize s.Process.Terminal = c.Config.Tty - s.Process.User.User = c.Config.User + s.Process.User.Username = c.Config.User // In spec.Root s.Root.Path = c.BaseFS diff --git a/libcontainerd/windowsoci/oci_windows.go b/libcontainerd/windowsoci/oci_windows.go index f38dcd33c0..63d5abdfb0 100644 --- a/libcontainerd/windowsoci/oci_windows.go +++ b/libcontainerd/windowsoci/oci_windows.go @@ -66,9 +66,16 @@ type Process struct { Cwd string `json:"cwd"` } -// User contains the user information for Windows +// User specifies specific user (and group) information for the container process. type User struct { - User string `json:"user,omitempty"` + // UID is the user id. + UID uint32 `json:"uid" platform:"linux,solaris"` + // GID is the group id. + GID uint32 `json:"gid" platform:"linux,solaris"` + // AdditionalGids are additional group ids set for the container's process. + AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` + // Username is the user name. + Username string `json:"username,omitempty" platform:"windows"` } // Root contains information about the container's root filesystem on the host.