vmalert: accept http.StatusOK for remotewrite (#1550)

This commit is contained in:
Alexander Rickardsson 2021-08-20 10:58:32 +02:00 committed by GitHub
parent f46a73dcdd
commit f4cecaf296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)