Skip to content

Commit

Permalink
Check in forward event
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisVQ committed Aug 30, 2024
1 parent ec15e0f commit 510de19
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions jenkins/webhook-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ func (c *ocClient) Forward(e *Event, triggerSecret string) (int, []byte, error)
e.Pipeline,
triggerSecret,
)

c.CheckJenkinsAvailability(e)
c.CheckDocGenAvailability(e)

log.Println(e.RequestID, "Forwarding to", url)

p := struct {
Expand Down Expand Up @@ -626,9 +630,6 @@ func (c *ocClient) CreateOrUpdatePipeline(exists bool, tmpl *template.Template,
return 500, err
}

c.CheckJenkinsAvailability(e)
c.CheckDocGenAvailability(e)

url := fmt.Sprintf(
"%s/namespaces/%s/buildconfigs",
c.OpenShiftAPIBaseURL,
Expand Down Expand Up @@ -670,9 +671,6 @@ func (c *ocClient) DeletePipeline(e *Event) error {
e.Pipeline,
)

c.CheckJenkinsAvailability(e)
c.CheckDocGenAvailability(e)

req, _ := http.NewRequest(
"DELETE",
url,
Expand Down

0 comments on commit 510de19

Please sign in to comment.