Conversation
Fixes #5575 Now that only viz makes use of the `SelfCheck` api, merged the `healthcheck.proto` into `viz.proto`. Also removed the "checkRPC" functionality that was used for handling multiple API responses and was only used by `SelfCheck`, because the extra complexity was not granted. Revert to use the plain vanilla "check" by just concatenating error responses. ## Success Output ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... √ viz extension self-check ``` ## Failure Examples Failure when viz fails to connect to the k8s api: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to both the k8s api and Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ```
dadjeibaah
approved these changes
Feb 4, 2021
Contributor
dadjeibaah
left a comment
There was a problem hiding this comment.
This LGTM. I left one tiny TIOLI. 📦 🚢
| WithCheckRPC(func(ctx context.Context) (*healthcheckPb.SelfCheckResponse, error) { | ||
| return hc.vizAPIClient.SelfCheck(ctx, &healthcheckPb.SelfCheckRequest{}) | ||
| WithCheck(func(ctx context.Context) error { | ||
| results, err := hc.vizAPIClient.SelfCheck(ctx, &pb.SelfCheckRequest{}) |
Contributor
There was a problem hiding this comment.
tiny TIOL but I like to leave a little bit of whitespace around code block operations. I find that it helps in code readability:
diff --git a/viz/pkg/healthcheck/healthcheck.go b/viz/pkg/healthcheck/healthcheck.go
index e6ae2f44..fcf6b7e4 100644
--- a/viz/pkg/healthcheck/healthcheck.go
+++ b/viz/pkg/healthcheck/healthcheck.go
@@ -185,9 +185,11 @@ func (hc *HealthChecker) VizCategory() healthcheck.Category {
if err != nil {
return err
}
+
if len(results.GetResults()) == 0 {
return errors.New("No results returned")
}
+
errs := []string{}
for _, res := range results.GetResults() {
if res.GetStatus() != pb.CheckStatus_OK {
@@ -197,6 +199,7 @@ func (hc *HealthChecker) VizCategory() healthcheck.Category {
if len(errs) == 0 {
return nil
}
+
errsStr := strings.Join(errs, "\n ")
return errors.New(errsStr)
}),
jijeesh
pushed a commit
to jijeesh/linkerd2
that referenced
this pull request
Mar 23, 2021
Fixes linkerd#5575 Now that only viz makes use of the `SelfCheck` api, merged the `healthcheck.proto` into `viz.proto`. Also removed the "checkRPC" functionality that was used for handling multiple API responses and was only used by `SelfCheck`, because the extra complexity was not granted. Revert to use the plain vanilla "check" by just concatenating error responses. ## Success Output ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... √ viz extension self-check ``` ## Failure Examples Failure when viz fails to connect to the k8s api: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to both the k8s api and Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Signed-off-by: Jijeesh <jijeesh.ka@gmail.com>
jijeesh
pushed a commit
to jijeesh/linkerd2
that referenced
this pull request
Apr 21, 2021
Fixes linkerd#5575 Now that only viz makes use of the `SelfCheck` api, merged the `healthcheck.proto` into `viz.proto`. Also removed the "checkRPC" functionality that was used for handling multiple API responses and was only used by `SelfCheck`, because the extra complexity was not granted. Revert to use the plain vanilla "check" by just concatenating error responses. ## Success Output ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... √ viz extension self-check ``` ## Failure Examples Failure when viz fails to connect to the k8s api: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Failure when viz fails to connect to both the k8s api and Prometheus: ```bash $ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are × ``` Signed-off-by: Jijeesh <jijeesh.ka@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5575
Now that only viz makes use of the
SelfCheckapi, merged thehealthcheck.protointoviz.proto.Also removed the "checkRPC" functionality that was used for handling multiple API responses and was only used by
SelfCheck, because the extra complexity was not granted. Revert to use the plain vanilla "check" by just concatenating error responses.Success Output
Failure Examples
Failure when viz fails to connect to the k8s api:
$ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are ×Failure when viz fails to connect to Prometheus:
$ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are ×Failure when viz fails to connect to both the k8s api and Prometheus:
$ bin/linkerd viz check ... linkerd-viz ----------- ... × viz extension self-check Error calling the Kubernetes API: someerror Error calling Prometheus from the control plane: someerror see https://linkerd.io/checks/#l5d-api-control-api for hints Status check results are ×