Skip to content

Commit 814617f

Browse files
committed
fix: clarify healthcheck help defaults
Signed-off-by: immanuwell <pchpr.00@list.ru>
1 parent b4c5feb commit 814617f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

cmd/nerdctl/container/container_run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ func setCreateFlags(cmd *cobra.Command) {
250250

251251
// Health check flags
252252
cmd.Flags().String("health-cmd", "", "Command to run to check health")
253-
cmd.Flags().Duration("health-interval", 0, "Time between running the check (default: 30s)")
254-
cmd.Flags().Duration("health-timeout", 0, "Maximum time to allow one check to run (default: 30s)")
255-
cmd.Flags().Int("health-retries", 0, "Consecutive failures needed to report unhealthy (default: 3)")
253+
cmd.Flags().Duration("health-interval", 0, "Time between running the check; 0 uses the image value or 30s when unset there too")
254+
cmd.Flags().Duration("health-timeout", 0, "Maximum time to allow one check to run; 0 uses the image value or 30s when unset there too")
255+
cmd.Flags().Int("health-retries", 0, "Consecutive failures needed to report unhealthy; 0 uses the image value or 3 when unset there too")
256256
cmd.Flags().Duration("health-start-period", 0, "Start period for the container to initialize before starting health-retries countdown")
257257
cmd.Flags().Bool("no-healthcheck", false, "Disable any container-specified HEALTHCHECK")
258258

cmd/nerdctl/container/container_run_help_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ func TestRunHelpDoesNotDuplicateDefaults(t *testing.T) {
4141
assert.Assert(t, !strings.Contains(help, "Tune container memory swappiness (0 to 100) (default -1) (default -1)"))
4242
assert.Assert(t, strings.Contains(help, "Allow running systemd in this container (default \"false\")"))
4343
assert.Assert(t, !strings.Contains(help, "Allow running systemd in this container (default: false) (default \"false\")"))
44+
assert.Assert(t, strings.Contains(help, "Time between running the check; 0 uses the image value or 30s when unset there too"))
45+
assert.Assert(t, strings.Contains(help, "Maximum time to allow one check to run; 0 uses the image value or 30s when unset there too"))
46+
assert.Assert(t, strings.Contains(help, "Consecutive failures needed to report unhealthy; 0 uses the image value or 3 when unset there too"))
4447
}

0 commit comments

Comments
 (0)