Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added timeout flag to multicluster check command #11420

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions multicluster/cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ const (
)

type checkOptions struct {
wait time.Duration
output string
wait time.Duration
output string
timeout time.Duration
}

func newCheckOptions() *checkOptions {
return &checkOptions{
wait: 300 * time.Second,
output: healthcheck.TableOutput,
wait: 300 * time.Second,
output: healthcheck.TableOutput,
timeout: 10 * time.Second,
}
}

Expand Down Expand Up @@ -107,6 +109,7 @@ non-zero exit code.`,
}
cmd.Flags().StringVarP(&options.output, "output", "o", options.output, "Output format. One of: table, json, short")
cmd.Flags().DurationVar(&options.wait, "wait", options.wait, "Maximum allowed time for all tests to pass")
cmd.Flags().DurationVar(&options.timeout, "timeout", options.timeout, "Timeout for calls to the Kubernetes API")
cmd.Flags().Bool("proxy", false, "")
cmd.Flags().MarkHidden("proxy")
cmd.Flags().StringP("namespace", "n", "", "")
Expand Down Expand Up @@ -151,7 +154,7 @@ func configureAndRunChecks(wout io.Writer, werr io.Writer, options *checkOptions
}

hc := newHealthChecker(linkerdHC)
category := multiclusterCategory(hc, options.wait)
category := multiclusterCategory(hc, options.timeout)
hc.AppendCategories(category)
success, warning := healthcheck.RunChecks(wout, werr, hc, options.output)
healthcheck.PrintChecksResult(wout, options.output, success, warning)
Expand Down
Loading