-
Notifications
You must be signed in to change notification settings - Fork 420
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
Don't log Fatal when handling events in the eventlistener #810
Conversation
…event. For this case, Fatalf causes the process to exit, and so the container cycles. This also adds a little bit of testing for this functionality, and to do so brings in a slightly newer version of the zap logging package.
/kind bug |
@@ -87,7 +90,7 @@ func getSinkAssets(t *testing.T, resources test.Resources, elName string, auth A | |||
clients := test.SeedResources(t, ctx, resources) | |||
test.AddTektonResources(clients.Kube) | |||
|
|||
logger, _ := zap.NewProduction() | |||
logger := zaptest.NewLogger(t) |
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.
nice!
Thanks for the fix and adding the test! @bigkevmcd The other two places where we use |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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 |
Changes
Don't log with Fatal when we can't fetch resources.
For this case, Fatalf causes the process to exit, and so the container cycles.
Fixes: #809
I had a look through the other cases where we're using Fatalf on the logger, and they all look like non-user error cases
It's not clear whether or not these should also be fixed for example this pattern is used twice:
https://github.com/tektoncd/triggers/blob/master/pkg/client/injection/reconciler/triggers/v1alpha1/eventlistener/controller.go#L55
This issue also doesn't look like a user could trigger it:
https://github.com/tektoncd/triggers/blob/master/pkg/client/injection/reconciler/triggers/v1alpha1/eventlistener/reconciler.go#L134
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes