Skip to content
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

Remove unused variable #515

Merged
merged 1 commit into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (r Sink) HandleEvent(response http.ResponseWriter, request *http.Request) {
}

//The eventlistener waits until all the trigger executions (up-to the creation of the resources) and
//only when at least one of the execution completed successfully, it returns response code 201(Accepted) otherwise it returns 202 (Created).
//only when at least one of the execution completed successfully, it returns response code 201(Created) otherwise it returns 202 (Accepted).
code := http.StatusAccepted
for i := 0; i < len(el.Spec.Triggers); i++ {
thiscode := <-result
Expand Down Expand Up @@ -144,7 +144,7 @@ func (r Sink) processTrigger(t *triggersv1.EventListenerTrigger, request *http.R
}
log := eventLog.With(zap.String(triggersv1.TriggerLabelKey, t.Name))

finalPayload, header, err := r.executeInterceptors(t, request, event, eventID, log)
finalPayload, header, err := r.executeInterceptors(t, request, event, log)
if err != nil {
log.Error(err)
return err
Expand Down Expand Up @@ -178,7 +178,7 @@ func (r Sink) processTrigger(t *triggersv1.EventListenerTrigger, request *http.R
return nil
}

func (r Sink) executeInterceptors(t *triggersv1.EventListenerTrigger, in *http.Request, event []byte, eventID string, log *zap.SugaredLogger) ([]byte, http.Header, error) {
func (r Sink) executeInterceptors(t *triggersv1.EventListenerTrigger, in *http.Request, event []byte, log *zap.SugaredLogger) ([]byte, http.Header, error) {
if len(t.Interceptors) == 0 {
return event, in.Header, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sink/sink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func TestExecuteInterceptor(t *testing.T) {
if err != nil {
t.Fatalf("http.NewRequest: %v", err)
}
resp, header, err := r.executeInterceptors(trigger, req, []byte(`{}`), "", logger)
resp, header, err := r.executeInterceptors(trigger, req, []byte(`{}`), logger)
if err != nil {
t.Fatalf("executeInterceptors: %v", err)
}
Expand Down Expand Up @@ -671,7 +671,7 @@ func TestExecuteInterceptor_error(t *testing.T) {
if err != nil {
t.Fatalf("http.NewRequest: %v", err)
}
if resp, _, err := s.executeInterceptors(trigger, req, nil, "", logger); err == nil {
if resp, _, err := s.executeInterceptors(trigger, req, nil, logger); err == nil {
t.Errorf("expected error, got: %+v, %v", string(resp), err)
}

Expand Down