Browse code

Revert Box from HostConfig

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/09/21 04:01:04
Showing 3 changed files
... ...
@@ -313,7 +313,7 @@ type HostConfig struct {
313 313
 	Runtime         string            `json:",omitempty"` // Runtime to use with this container
314 314
 
315 315
 	// Applicable to Windows
316
-	ConsoleSize Box       // Initial console size
316
+	ConsoleSize [2]uint   // Initial console size (height,width)
317 317
 	Isolation   Isolation // Isolation technology of the container (eg default, hyperv)
318 318
 
319 319
 	// Contains container's resources (cgroups, ulimits)
... ...
@@ -325,9 +325,3 @@ type HostConfig struct {
325 325
 	// Run a custom init inside the container, if null, use the daemon's configured settings
326 326
 	Init *bool `json:",omitempty"`
327 327
 }
328
-
329
-// Box specifies height and width dimensions. Used for sizing of a console.
330
-type Box struct {
331
-	Height uint
332
-	Width  uint
333
-}
... ...
@@ -135,7 +135,7 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions
135 135
 	// a far better user experience rather than relying on subsequent resizes
136 136
 	// to cause things to catch up.
137 137
 	if runtime.GOOS == "windows" {
138
-		hostConfig.ConsoleSize.Height, hostConfig.ConsoleSize.Width = dockerCli.Out().GetTtySize()
138
+		hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.Out().GetTtySize()
139 139
 	}
140 140
 
141 141
 	ctx, cancelFun := context.WithCancel(context.Background())
... ...
@@ -71,8 +71,8 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e
71 71
 		s.Process.Cwd = `C:\`
72 72
 	}
73 73
 	s.Process.Env = c.CreateDaemonEnvironment(linkedEnv)
74
-	s.Process.ConsoleSize.Height = c.HostConfig.ConsoleSize.Height
75
-	s.Process.ConsoleSize.Width = c.HostConfig.ConsoleSize.Width
74
+	s.Process.ConsoleSize.Height = c.HostConfig.ConsoleSize[0]
75
+	s.Process.ConsoleSize.Width = c.HostConfig.ConsoleSize[1]
76 76
 	s.Process.Terminal = c.Config.Tty
77 77
 	s.Process.User.Username = c.Config.User
78 78