-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix error reporting #8250
Fix error reporting #8250
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #8250 +/- ##
==========================================
+ Coverage 47.45% 51.58% +4.12%
==========================================
Files 143 143
Lines 14724 14732 +8
==========================================
+ Hits 6988 7599 +611
+ Misses 6631 5931 -700
- Partials 1105 1202 +97
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
pkg/agent/containerd/containerd.go
Outdated
@@ -93,7 +93,7 @@ func Run(ctx context.Context, cfg *config.Node) error { | |||
|
|||
addDeathSig(cmd) | |||
if err := cmd.Run(); err != nil { | |||
fmt.Fprintf(os.Stderr, "containerd: %s\n", err) | |||
logrus.Errorf("containerd failed: %s", err) |
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.
nit: in other places we say "exited" when things exit unexpectedly
logrus.Errorf("containerd failed: %s", err) | |
logrus.Errorf("containerd exited: %s", err) |
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! Done
Signed-off-by: Manuel Buil <[email protected]>
2da7271
to
d3f7632
Compare
Code freeze period. No merging! |
Proposed Changes
Use logrus to report the error instead of fmt to avoid an rke2 windows bug.
This fixes: rancher/rke2#4693
To report stuff on Windows Event Logger, we are using a logrus hook, i.e. any log created by logrus, gets printed in the Event Tracing for Windows (EWT) (some sort of journalctl). However, anything else is dropped, e.g. fmt messages.
https://github.com/rancher/wins/blob/main/pkg/logs/etw.go#L125-L132
Types of Changes
Bugfix
Verification
Try breaking something in containerd/k3s and check that it gets reported correctly in journalctl
Testing
The bug is in rke2
Linked Issues
rancher/rke2#4693
#8251
User-Facing Change
Further Comments