浏览代码

Fix run default value for health check retries

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif 5 年之前
父节点
当前提交
575307d8af
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      cli/cmd/run/run.go
  2. 1 1
      cli/cmd/run/testdata/run-help.golden

+ 1 - 1
cli/cmd/run/run.go

@@ -62,7 +62,7 @@ func Command(contextType string) *cobra.Command {
 	cmd.Flags().BoolVar(&opts.Rm, "rm", false, "Automatically remove the container when it exits")
 	cmd.Flags().StringVar(&opts.HealthCmd, "health-cmd", "", "Command to run to check health")
 	cmd.Flags().DurationVar(&opts.HealthInterval, "health-interval", time.Duration(0), "Time between running the check (ms|s|m|h) (default 0s)")
-	cmd.Flags().IntVar(&opts.HealthRetries, "health-retries", 10, "Consecutive failures needed to report unhealthy")
+	cmd.Flags().IntVar(&opts.HealthRetries, "health-retries", 0, "Consecutive failures needed to report unhealthy")
 	cmd.Flags().DurationVar(&opts.HealthStartPeriod, "health-start-period", time.Duration(0), "Start period for the container to initialize before starting "+
 		"health-retries countdown (ms|s|m|h) (default 0s)")
 	cmd.Flags().DurationVar(&opts.HealthTimeout, "health-timeout", time.Duration(0), "Maximum time to allow one check to run (ms|s|m|h) (default 0s)")

+ 1 - 1
cli/cmd/run/testdata/run-help.golden

@@ -11,7 +11,7 @@ Flags:
       --env-file stringArray           Path to environment files to be translated as environment variables
       --health-cmd string              Command to run to check health
       --health-interval duration       Time between running the check (ms|s|m|h) (default 0s)
-      --health-retries int             Consecutive failures needed to report unhealthy (default 10)
+      --health-retries int             Consecutive failures needed to report unhealthy
       --health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
       --health-timeout duration        Maximum time to allow one check to run (ms|s|m|h) (default 0s)
   -l, --label stringArray              Set meta data on a container