-
Notifications
You must be signed in to change notification settings - Fork 22
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
🎁 Easier debugging, especially for the in-cluster sender #375
🎁 Easier debugging, especially for the in-cluster sender #375
Conversation
Skipping CI for Draft Pull Request. |
8891e5a
to
354fe78
Compare
stringRE = regexp.MustCompile(`\s+"[^"]+"\s+`) | ||
) | ||
|
||
func errorHandler(err error, cmd *cobra.Command) bool { |
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.
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.
Here's an example of successful log file contents: https://gist.github.com/cardil/6151fae7d7b9c5f8ffdcf6469d6ea27b
And here is a failure example: https://gist.github.com/cardil/af129bb83cbfb018b93921babd513467
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.
With ff89790 I added gathering of K8s' events as well. That should collect all the info we'll need for debugging: job, pods, and events.
Here's updated successful log (converted to JSON array, for readability): https://gist.github.com/cardil/d8b7963c10e7b6e3befcc112916965c7
And here is a failure example (also as JSON array): https://gist.github.com/cardil/d1216a51f483f242ed39517f4ede9a9c
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.
Here's how the error handling and the kn client tui package animation plays well:
Template: corev1.PodTemplateSpec{ | ||
Spec: corev1.PodSpec{ | ||
RestartPolicy: corev1.RestartPolicyNever, | ||
RestartPolicy: corev1.RestartPolicyNever, | ||
ActiveDeadlineSeconds: deadline(), |
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.
Using this deadline should be safe (the image download time isn't counting into this deadline), as checked here: https://drive.google.com/file/d/19js79hNTqPJG7CogHH7O6-CRSijDXRNE/view
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #375 +/- ##
==========================================
+ Coverage 66.52% 68.92% +2.39%
==========================================
Files 48 52 +4
Lines 1440 1622 +182
==========================================
+ Hits 958 1118 +160
- Misses 412 424 +12
- Partials 70 80 +10 ☔ View full report in Codecov by Sentry. |
c705d11
to
52f8f71
Compare
/test all |
f60b532
to
9f237ff
Compare
Nice PR, great work! I do not have much time to review it thoroughly, but I am happy to ack it. @cardil, is there anything you want to add before merging? |
Thanks. The PR works great, so I'm happy to merge it. BTW. I think we can adopt very similar error processing across all of kn and fun. WDYT? |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil, dsimansk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
That sounds like a good idea. Maybe start with talking to the func team, as this has more interactive elements already anyway. Also, we need to be sure, that the spinner is only active if there is a tty. Not sure if the PR deals already with that, that when no tty is available (i.e. used in a pipe or a redirection), then no control characters or colors should be printed. |
That's already addressed in knative.dev/client/pkg library and in bubblegum library as well. |
* Backport of knative-extensions#375 * Use github.com/openshift-knative/client after openshift-knative/client#504
Changes
/kind enhancement
Fixes #129
Release Note