Skip to content

Commit

Permalink
Add validation for cloudevent uri in Sink
Browse files Browse the repository at this point in the history
Send cloud event only when CloudEventURI is defined. Otherwise,
logger will clog up the pod logs.
  • Loading branch information
khrm authored and tekton-robot committed Feb 23, 2022
1 parent 474283f commit 0e3227a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ func (r Sink) sendCloudEvents(headers http.Header, el triggersv1.EventListener,
return
}

// If no cloudEventURI, then don't try to sendCloudEvents
if r.CloudEventURI == "" {
return
}

resource := cloudevent.Resource{
EventID: eventID,
EventType: eventType,
Expand Down

0 comments on commit 0e3227a

Please sign in to comment.