浏览代码

implement healthcheck.disable by setting Test: "NONE"

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 4 年之前
父节点
当前提交
907e8e1f24
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      local/moby/convert.go

+ 5 - 1
local/moby/convert.go

@@ -132,8 +132,12 @@ func ToMobyHealthCheck(check *compose.HealthCheckConfig) *container.HealthConfig
 	if check.Retries != nil {
 		retries = int(*check.Retries)
 	}
+	test := check.Test
+	if check.Disable {
+		test = []string{"NONE"}
+	}
 	return &container.HealthConfig{
-		Test:        check.Test,
+		Test:        test,
 		Interval:    interval,
 		Timeout:     timeout,
 		StartPeriod: period,