From 9e2e9d83a5f528d4b4cb48f96a9e9600dc7184bd Mon Sep 17 00:00:00 2001 From: Alexander Rickardsson Date: Fri, 20 Aug 2021 10:58:32 +0200 Subject: [PATCH] vmalert: accept http.StatusOK for remotewrite (#1550) --- app/vmalert/remotewrite/remotewrite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vmalert/remotewrite/remotewrite.go b/app/vmalert/remotewrite/remotewrite.go index 3647f4f32d..8df1a19418 100644 --- a/app/vmalert/remotewrite/remotewrite.go +++ b/app/vmalert/remotewrite/remotewrite.go @@ -244,7 +244,7 @@ func (c *Client) send(ctx context.Context, data []byte) error { req.URL, err, len(data), r.Size()) } defer func() { _ = resp.Body.Close() }() - if resp.StatusCode != http.StatusNoContent { + if resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusOK { body, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf("unexpected response code %d for %s. Response body %q", resp.StatusCode, req.URL, body)