diff --git a/pkg/sink/sink.go b/pkg/sink/sink.go index 30d459ba8..2f4c3638c 100644 --- a/pkg/sink/sink.go +++ b/pkg/sink/sink.go @@ -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 @@ -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 @@ -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 } diff --git a/pkg/sink/sink_test.go b/pkg/sink/sink_test.go index cee6a5aa4..716df7225 100644 --- a/pkg/sink/sink_test.go +++ b/pkg/sink/sink_test.go @@ -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) } @@ -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) }