-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Adding distinct exit codes for cluster connection failures. #4933
Adding distinct exit codes for cluster connection failures. #4933
Conversation
pkg/skaffold/errors/err_map.go
Outdated
regexp: re(fmt.Sprintf(".*%s.* Uanable to connect: .*", ClusterConnectErrPrefix)), | ||
errCode: proto.StatusCode_DEPLOY_CLUSTER_CONNECTION_ERR, | ||
description: func(error) string { | ||
return "Deploy Failed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this gets turned into the log entry, which is then reflected to the output on the IDEs. Maybe "Unable to connect to cluster"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description
is not used in the Event API but only for the console.
The ActionableErr.Message
which is the raw error is used.
I made a conscious decision to send the raw error to IDEs to they could do any extra processing of the error message.
Maybe it makes sense to send the description
or we could change or add another field to the ActionableErr
e.g.
ProcessedMessage
or ExtractedMessage
along with the raw error text in Message
.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only wondered if Skaffold would swallow the Unable to connect
and instead report Deploy Failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. got it. something like this
Deploy Failed. Check your connection for the cluster test_cluster.
Vs what we have right now.
Deploy Failed. Could not connect to cluster test_cluster due to \"https://192.168.64.3:8443/version?timeout=32s\": net/http: TLS handshake timeout.
Check your connection for the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes the message more readable / actionable.
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent |
Codecov Report
@@ Coverage Diff @@
## master #4933 +/- ##
=======================================
Coverage 72.19% 72.19%
=======================================
Files 362 363 +1
Lines 12715 12749 +34
=======================================
+ Hits 9179 9204 +25
- Misses 2855 2863 +8
- Partials 681 682 +1
Continue to review full report at Codecov.
|
afaa476
to
aa17382
Compare
BTW: this code path is never run on the first iteration of
But there are no events:
|
@PriyaModali Can you please verify? |
Currently, we suggest "Check cluster connection" as a suggestion. @gsquared94 added a PR to detect if a context is We could use this functionality to suggest
It would be great, if for conditions 1 and 2, if we can actually run
You can follow up the above two changes in another PR and create an issue for this. |
Updated the deploy error fromat.
Looks like accidentally deleted the error display logic during the merge process. Added it back.
Looks like accidentally deleted the error display logging during the merge. Added it back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use evaluated kubeContext to check if cluster is local/minikube.
- Mock
isMinkube
and add all variations of tests.
- isMinikube=true, clusterName = minikube
- isMinikube=true, clusterName = some_random
- isMinikube=false, cluterName = 'test_cluster" (what you have right now)
We spoke in our 1:1 on Friday, to switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code Looks good to me expect for 1 nit.
Fixes: #4645
Related: Tracking issue #4921
Description
Adding distinct exit codes for cluster connection failures.
User facing changes
These changes will enable Skaffold dev, deploy, to return distinct error codes when kubernetes cluster could not be reached.
Ex. before error messages:
Ex. after error messages: