Pin dependencies and update vendors

This commit is contained in:
Wenjia Zhang
2019-10-23 13:37:36 -07:00
parent 9ead9373f3
commit 660b17d0ae
716 changed files with 32002 additions and 21702 deletions

View File

@@ -3,6 +3,7 @@ package probing
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"sync"
"time"
@@ -60,6 +61,10 @@ func (p *prober) AddHTTP(id string, probingInterval time.Duration, endpoints []s
panic(err)
}
resp, err := p.tr.RoundTrip(req)
if err == nil && resp.StatusCode != http.StatusOK {
err = fmt.Errorf("got unexpected HTTP status code %s from %s", resp.Status, endpoints[pinned])
resp.Body.Close()
}
if err != nil {
s.recordFailure(err)
pinned = (pinned + 1) % len(endpoints)