updating cadvisor deps

Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
Vishnu kannan
2016-07-19 17:20:25 -07:00
parent a0a0760027
commit cdeaef2c05
122 changed files with 6209 additions and 2355 deletions

View File

@@ -15,15 +15,27 @@
package cloudinfo
import (
"io/ioutil"
"strings"
info "github.com/google/cadvisor/info/v1"
"github.com/golang/glog"
"google.golang.org/cloud/compute/metadata"
)
const (
gceProductName = "/sys/class/dmi/id/product_name"
google = "Google"
)
func onGCE() bool {
return metadata.OnGCE()
data, err := ioutil.ReadFile(gceProductName)
if err != nil {
glog.V(2).Infof("Error while reading product_name: %v", err)
return false
}
return strings.Contains(string(data), google)
}
func getGceInstanceType() info.InstanceType {