Merge pull request #22803 from derekwaynecarr/update_cadvisor

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2016-03-11 21:52:21 -08:00
commit afba2f75d1
4 changed files with 51 additions and 43 deletions

72
Godeps/Godeps.json generated
View File

@ -578,93 +578,93 @@
},
{
"ImportPath": "github.com/google/cadvisor/api",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/cache/memory",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/collector",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/container",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/events",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/fs",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/healthz",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/http",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/info/v1",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/info/v2",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/manager",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/metrics",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/pages",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/storage",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/summary",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/utils",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/validate",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/cadvisor/version",
"Comment": "v0.22.0",
"Rev": "e39fb02c89f2b39808bc1723108cde5bb510e102"
"Comment": "v0.22.1",
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
},
{
"ImportPath": "github.com/google/gofuzz",

View File

@ -121,11 +121,11 @@ type NetInfo struct {
type CloudProvider string
const (
GCE CloudProvider = "GCE"
AWS = "AWS"
Azure = "Azure"
Baremetal = "Baremetal"
UnkownProvider = "Unknown"
GCE CloudProvider = "GCE"
AWS = "AWS"
Azure = "Azure"
Baremetal = "Baremetal"
UnknownProvider = "Unknown"
)
type InstanceType string

View File

@ -15,6 +15,8 @@
package cloudinfo
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
@ -23,7 +25,13 @@ import (
)
func onAWS() bool {
client := ec2metadata.New(session.New(&aws.Config{}))
// the default client behavior retried the operation multiple times with a 5s timeout per attempt.
// if you were not on aws, you would block for 20s when invoking this operation.
// we reduce retries to 0 and set the timeout to 2s to reduce the time this blocks when not on aws.
client := ec2metadata.New(session.New(&aws.Config{MaxRetries: aws.Int(0)}))
if client.Config.HTTPClient != nil {
client.Config.HTTPClient.Timeout = time.Duration(2 * time.Second)
}
return client.Available()
}

View File

@ -66,7 +66,7 @@ func detectCloudProvider() info.CloudProvider {
case onBaremetal():
return info.Baremetal
}
return info.UnkownProvider
return info.UnknownProvider
}
func detectInstanceType(cloudProvider info.CloudProvider) info.InstanceType {