-
Notifications
You must be signed in to change notification settings - Fork 612
Plumb context through crane and gcrane #995
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #995 +/- ##
==========================================
- Coverage 75.24% 75.15% -0.09%
==========================================
Files 107 107
Lines 5058 5064 +6
==========================================
Hits 3806 3806
- Misses 706 712 +6
Partials 546 546 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| return remote.Catalog(context.TODO(), reg, o.remote...) | ||
| return remote.Catalog(context.Background(), reg, o.remote...) |
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.
Not plumbing context through here?
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 remote.WithContext in o.remote... will override it.
|
|
||
| if err := root.Execute(); err != nil { | ||
| fmt.Println(err) | ||
| ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt) |
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.
defer cancel () instead?
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.
Doesn't os.Exit(1) pre-empt it?
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.
ended up doing both instead
053a029 to
3750ef0
Compare
Also, use signal.NotifyContext for cancelling the ctx.
Fixes #912
Also, use signal.NotifyContext for cancelling the ctx.
Also, don't log errors twice now that we're using RunE.