Simplify swappiness check

As suggested in https://github.com/docker/docker/pull/14004/files#r34022527

The concern there is we can't differentiate whether user explicitly
asked for an invalid value of -1 or he did not specify anything.

I don't think this would be a problem, because:
 - like all other default values like zero, we can't differentiate
   user specify it or not, most of which, zeros are also invalid, so
   default is default, we show these default values in help info,
   so users would know if they set value as default, it'll be like
   they set nothing.
 - we can't do this kind of string check in REST api request, so
   it'll make the behave different from docker command and RESTapi.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 6f8ddec1d0e67058c7a4a15c7d4d9a75bc1e5dea
Component: engine
This commit is contained in:
Qiang Huang
2015-07-20 16:10:10 +08:00
parent 2591c62680
commit da9ff50d73
3 changed files with 7 additions and 19 deletions
@@ -75,11 +75,6 @@ func (s *DockerSuite) TestRunWithSwappinessInvalid(c *check.C) {
if err == nil {
c.Fatalf("failed. test was able to set invalid value, output: %q", out)
}
runCmd = exec.Command(dockerBinary, "run", "--memory-swappiness", "-1", "busybox", "true")
out, _, err = runCommandWithOutput(runCmd)
if err == nil {
c.Fatalf("failed. test was able to set invalid value, output: %q", out)
}
}
// "test" should be printed