Update to latest cadvisor - cleanup mesos/rkt
Change-Id: Ib5ae0cb13b93f8c87bb74e3ba33040df5f3d6a6f
This commit is contained in:
7
vendor/github.com/google/cadvisor/container/crio/client.go
generated
vendored
7
vendor/github.com/google/cadvisor/container/crio/client.go
generated
vendored
@@ -122,6 +122,13 @@ func (c *crioClientImpl) ContainerInfo(id string) (*ContainerInfo, error) {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// golang's http.Do doesn't return an error if non 200 response code is returned
|
||||
// handle this case here, rather than failing to decode the body
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("Error finding container %s: Status %d returned error %s", id, resp.StatusCode, resp.Body)
|
||||
}
|
||||
|
||||
cInfo := ContainerInfo{}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&cInfo); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user