Browse code

Deprecate -c cli short variant flag in docker run

Signed-off-by: Antonio Murdaca <runcom@linux.com>

Antonio Murdaca authored on 2015/09/14 05:30:10
Showing 3 changed files
... ...
@@ -12,6 +12,16 @@ parent = "mn_use_docker"
12 12
 
13 13
 The following list of features are deprecated.
14 14
 
15
+### Command line short variant options
16
+**Deprecated In Release: v1.9**
17
+
18
+**Target For Removal In Release: v1.11**
19
+
20
+The following short variant options are deprecated in favor of their long
21
+variants:
22
+
23
+    docker run -c (--cpu-shares)
24
+
15 25
 ### Driver Specific Log Tags
16 26
 **Deprecated In Release: v1.9**
17 27
 
... ...
@@ -23,8 +33,6 @@ Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` a
23 23
 
24 24
     docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
25 25
 
26
-
27
-
28 26
 ### LXC built-in exec driver
29 27
 **Deprecated In Release: v1.8**
30 28
 
... ...
@@ -217,9 +217,9 @@ func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) {
217 217
 // "test" should be printed
218 218
 func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) {
219 219
 	testRequires(c, cpuShare)
220
-	out, _ := dockerCmd(c, "run", "-c", "1000", "busybox", "echo", "test")
220
+	out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "busybox", "echo", "test")
221 221
 	if out != "test\n" {
222
-		c.Errorf("container should've printed 'test'")
222
+		c.Errorf("container should've printed 'test', got %q instead", out)
223 223
 	}
224 224
 }
225 225
 
... ...
@@ -227,7 +227,7 @@ func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) {
227 227
 func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) {
228 228
 	testRequires(c, cpuShare)
229 229
 	testRequires(c, memoryLimitSupport)
230
-	out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-c", "1000", "-m", "16m", "busybox", "echo", "test")
230
+	out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test")
231 231
 	if out != "test\n" {
232 232
 		c.Errorf("container should've printed 'test', got %q instead", out)
233 233
 	}
... ...
@@ -291,7 +291,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
291 291
 // "test" should be printed
292 292
 func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) {
293 293
 	testRequires(c, memoryLimitSupport)
294
-	out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-m", "16m", "busybox", "echo", "test")
294
+	out, _ := dockerCmd(c, "run", "-m", "16m", "busybox", "echo", "test")
295 295
 	out = strings.Trim(out, "\r\n")
296 296
 
297 297
 	if expected := "test"; out != expected {
... ...
@@ -80,7 +80,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
80 80
 		flKernelMemory    = cmd.String([]string{"-kernel-memory"}, "", "Kernel memory limit")
81 81
 		flUser            = cmd.String([]string{"u", "-user"}, "", "Username or UID (format: <name|uid>[:<group|gid>])")
82 82
 		flWorkingDir      = cmd.String([]string{"w", "-workdir"}, "", "Working directory inside the container")
83
-		flCPUShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
83
+		flCPUShares       = cmd.Int64([]string{"#c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
84 84
 		flCPUPeriod       = cmd.Int64([]string{"-cpu-period"}, 0, "Limit CPU CFS (Completely Fair Scheduler) period")
85 85
 		flCPUQuota        = cmd.Int64([]string{"-cpu-quota"}, 0, "Limit CPU CFS (Completely Fair Scheduler) quota")
86 86
 		flCpusetCpus      = cmd.String([]string{"#-cpuset", "-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")