Conversation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 63 out of 63 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 63 out of 63 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import ( | ||
| "context" | ||
| "errors" | ||
| "fmt" |
There was a problem hiding this comment.
The fmt package is imported but no longer used in this file after replacing fmt.Errorf with errors.Errorf. Remove the unused import.
| "fmt" |
| @@ -6,7 +6,6 @@ package postgrescluster | |||
|
|
|||
| import ( | |||
| "context" | |||
There was a problem hiding this comment.
The fmt package is imported but no longer used in this file after replacing fmt.Errorf with errors.Errorf. Remove the unused import.
commit: 7d2a1d5 |
https://perconadev.atlassian.net/browse/K8SPG-903
DESCRIPTION
This PR improves operator logs by adding stack traces to all errors.
There are multiple ways to achieve this. For example, the Crunchy codebase already uses standard
errors.WithStack(). However, in some parts of the code it is missing, which results in the operator logging errors without stack traces. To ensure stack traces using this approach, we would need to wrap every returned error witherrors.WithStack(), which is easy to forget and may be missed in the future.In our other operators, the common practice is to use the
github.com/pkg/errorspackage, which automatically includes a stack trace when errors are created or wrapped. By replacing"errors"with"github.com/pkg/errors", we can ensure that every error contains a stack trace.CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability