Bump cAdvisor (and dependencies) godeps version
This commit is contained in:
22
vendor/github.com/google/cadvisor/container/rkt/client.go
generated
vendored
22
vendor/github.com/google/cadvisor/container/rkt/client.go
generated
vendored
@@ -20,6 +20,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver"
|
||||
rktapi "github.com/coreos/rkt/api/v1alpha"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
@@ -29,6 +30,7 @@ import (
|
||||
const (
|
||||
defaultRktAPIServiceAddr = "localhost:15441"
|
||||
timeout = 2 * time.Second
|
||||
minimumRktBinVersion = "1.6.0"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -55,7 +57,25 @@ func Client() (rktapi.PublicAPIClient, error) {
|
||||
return
|
||||
}
|
||||
|
||||
rktClient = rktapi.NewPublicAPIClient(apisvcConn)
|
||||
apisvc := rktapi.NewPublicAPIClient(apisvcConn)
|
||||
|
||||
resp, err := apisvc.GetInfo(context.Background(), &rktapi.GetInfoRequest{})
|
||||
if err != nil {
|
||||
rktClientErr = fmt.Errorf("rkt: GetInfo() failed: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
binVersion, err := semver.Make(resp.Info.RktVersion)
|
||||
if err != nil {
|
||||
rktClientErr = fmt.Errorf("rkt: couldn't parse RtVersion: %v", err)
|
||||
return
|
||||
}
|
||||
if binVersion.LT(semver.MustParse(minimumRktBinVersion)) {
|
||||
rktClientErr = fmt.Errorf("rkt: binary version is too old(%v), requires at least %v", resp.Info.RktVersion, minimumRktBinVersion)
|
||||
return
|
||||
}
|
||||
|
||||
rktClient = apisvc
|
||||
})
|
||||
|
||||
return rktClient, rktClientErr
|
||||
|
Reference in New Issue
Block a user