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

Group checkers by category #2083

Merged
merged 3 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion cli/cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func configureAndRunChecks(options *checkOptions) error {
if err != nil {
return fmt.Errorf("Validation error when executing check command: %v", err)
}
checks := []healthcheck.Checks{
checks := []healthcheck.CategoryID{
healthcheck.KubernetesAPIChecks,
healthcheck.KubernetesVersionChecks,
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestCheckStatus(t *testing.T) {
t.Run("Prints expected output", func(t *testing.T) {
hc := healthcheck.NewHealthChecker(
[]healthcheck.Checks{},
[]healthcheck.CategoryID{},
&healthcheck.Options{},
)
hc.Add("category", "check1", func() error {
Expand Down
8 changes: 4 additions & 4 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func cliPublicAPIClient() pb.ApiClient {
// checks fail, then CLI will print an error and exit. If the retryDeadline
// param is specified, then the CLI will print a message to stderr and retry.
func validatedPublicAPIClient(retryDeadline time.Time, apiChecks bool) pb.ApiClient {
checks := []healthcheck.Checks{
checks := []healthcheck.CategoryID{
healthcheck.KubernetesAPIChecks,
healthcheck.LinkerdControlPlaneExistenceChecks,
}
Expand All @@ -124,11 +124,11 @@ func validatedPublicAPIClient(retryDeadline time.Time, apiChecks bool) pb.ApiCli
if result.Err != nil && !result.Warning {
var msg string
switch result.Category {
case healthcheck.KubernetesAPICategory:
case healthcheck.KubernetesAPIChecks:
msg = "Cannot connect to Kubernetes"
case healthcheck.LinkerdControlPlaneExistenceCategory:
case healthcheck.LinkerdControlPlaneExistenceChecks:
msg = "Cannot find Linkerd"
case healthcheck.LinkerdAPICategory:
case healthcheck.LinkerdAPIChecks:
msg = "Cannot connect to Linkerd"
}
fmt.Fprintf(os.Stderr, "%s: %s\n", msg, result.Err)
Expand Down
Loading