Treat all 2xx succesful in webhook, fixes #57

This commit is contained in:
Mustafa Akin
2020-06-22 17:36:56 +03:00
parent c4a5dd0857
commit d262b1f7c7
+1 -2
View File
@@ -53,8 +53,7 @@ func (w *Webhook) Send(ctx context.Context, ev *kube.EnhancedEvent) error {
return err
}
// TODO: make this prettier please
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
if resp.StatusCode >= 200 && resp.StatusCode < 300{
return errors.New("not 200/201: " + string(body))
}