Skip to content

Commit

Permalink
Merge pull request #28 from mercedes-benz/no-404
Browse files Browse the repository at this point in the history
feat: webhook does not return error on 'instance not found'.
  • Loading branch information
gabriel-samfira authored Oct 7, 2022
2 parents e0d1de6 + 5bfecba commit 59c8f39
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 59c8f39

Please sign in to comment.