Skip to content

Commit

Permalink
feat: webhook does not return error on 'instance not found'.
Browse files Browse the repository at this point in the history
This case is probably caused by a webhook event that was meant for
another runner controller / manager. No need to report this as
error, we can simply ignore this and avoid noise in the logs.
  • Loading branch information
maigl committed Oct 7, 2022
1 parent e0d1de6 commit 5bfecba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apiserver/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ func (a *APIController) handleWorkflowJobEvent(w http.ResponseWriter, r *http.Re
hookType := r.Header.Get("X-Github-Hook-Installation-Target-Type")

if err := a.r.DispatchWorkflowJob(hookType, signature, body); err != nil {
log.Printf("failed to dispatch work: %s", err)
if errors.Is(err, gErrors.ErrNotFound) {
log.Printf("got not found error from DispatchWorkflowJob. webhook not meant for us?: %q", err)
return
}
handleError(w, err)
return
}
Expand Down Expand Up @@ -183,7 +186,6 @@ func (a *APIController) FirstRunHandler(w http.ResponseWriter, r *http.Request)
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(newUser)

}

func (a *APIController) ListCredentials(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 5bfecba

Please sign in to comment.