-
Notifications
You must be signed in to change notification settings - Fork 152
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
Parse kopia errors #1973
Parse kopia errors #1973
Conversation
Thanks for submitting this pull request 🎉. The team will review it soon and get back to you. If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document. |
294e90e
to
4efd20f
Compare
4efd20f
to
86d98fc
Compare
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.
Minor question, looks good otherwise.
var kopiaErrorPattern = regexp.MustCompile(`ERROR\s+(.*)`) | ||
|
||
// ErrorFromOutput parses the output of a kopia and returns an error, if found | ||
func ErrorsFromOutput(output string) []error { |
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.
Is this function only for kopia repository
sub commands and not for other commands?
For example for kopia snapshot restore
commands, it could be of format:
error restoring: restore error: error copying: copy file: error creating file:
Another example could be:
error setting attributes: could not change owner/group
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.
Thanks, I added couple more cases. I went through Kopia's repo and found that they have several unstructured error logs, but they will be covered by generic "last x log lines" mechanism.
@ankitjain235 @pavannd1 do you think it's mergeable now ? |
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.
LGTM.
Change Overview
This PR introduces generic mechanism to parse Kopia errors.
Pull request type
Please check the type of change your PR introduces:
Test Plan