浏览代码

Fix Error in daemon_unix.go and docker_cli_run_unit_test.go

Signed-off-by: gunadhya <6939749+gunadhya@users.noreply.github.com>
(cherry picked from commit 64465f3b5fbde37ee165893248d80b24e51102aa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
gunadhya 4 年之前
父节点
当前提交
cda6988478
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      daemon/daemon_unix.go
  2. 1 1
      integration-cli/docker_cli_run_unix_test.go

+ 1 - 1
daemon/daemon_unix.go

@@ -461,7 +461,7 @@ func verifyPlatformContainerResources(resources *containertypes.Resources, sysIn
 		resources.MemoryReservation = 0
 	}
 	if resources.MemoryReservation > 0 && resources.MemoryReservation < linuxMinMemory {
-		return warnings, fmt.Errorf("Minimum memory reservation allowed is 4MB")
+		return warnings, fmt.Errorf("Minimum memory reservation allowed is 6MB")
 	}
 	if resources.Memory > 0 && resources.MemoryReservation > 0 && resources.Memory < resources.MemoryReservation {
 		return warnings, fmt.Errorf("Minimum memory limit can not be less than memory reservation limit, see usage")

+ 1 - 1
integration-cli/docker_cli_run_unix_test.go

@@ -697,7 +697,7 @@ func (s *DockerSuite) TestRunWithMemoryReservationInvalid(c *testing.T) {
 	assert.Assert(c, strings.Contains(strings.TrimSpace(out), expected), "run container should fail with invalid memory reservation")
 	out, _, err = dockerCmdWithError("run", "--memory-reservation", "1k", "busybox", "true")
 	assert.ErrorContains(c, err, "")
-	expected = "Minimum memory reservation allowed is 4MB"
+	expected = "Minimum memory reservation allowed is 6MB"
 	assert.Assert(c, strings.Contains(strings.TrimSpace(out), expected), "run container should fail with invalid memory reservation")
 }