updated cadvisor deps
This commit is contained in:
10
vendor/github.com/google/cadvisor/container/docker/factory.go
generated
vendored
10
vendor/github.com/google/cadvisor/container/docker/factory.go
generated
vendored
@@ -57,6 +57,12 @@ var (
|
||||
dockerRootDirFlag = flag.String("docker_root", "/var/lib/docker", "DEPRECATED: docker root is read from docker info (this is a fallback, default: /var/lib/docker)")
|
||||
|
||||
dockerRootDirOnce sync.Once
|
||||
|
||||
// flag that controls globally disabling thin_ls pending future enhancements.
|
||||
// in production, it has been found that thin_ls makes excessive use of iops.
|
||||
// in an iops restricted environment, usage of thin_ls must be controlled via blkio.
|
||||
// pending that enhancement, disable its usage.
|
||||
disableThinLs = true
|
||||
)
|
||||
|
||||
func RootDir() string {
|
||||
@@ -189,6 +195,10 @@ func startThinPoolWatcher(dockerInfo *dockertypes.Info) (*devicemapper.ThinPoolW
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if disableThinLs {
|
||||
return nil, fmt.Errorf("usage of thin_ls is disabled to preserve iops")
|
||||
}
|
||||
|
||||
dockerThinPoolName, err := dockerutil.DockerThinPoolName(*dockerInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
8
vendor/github.com/google/cadvisor/container/docker/handler.go
generated
vendored
8
vendor/github.com/google/cadvisor/container/docker/handler.go
generated
vendored
@@ -252,9 +252,11 @@ func newDockerContainerHandler(
|
||||
// split env vars to get metadata map.
|
||||
for _, exposedEnv := range metadataEnvs {
|
||||
for _, envVar := range ctnr.Config.Env {
|
||||
splits := strings.SplitN(envVar, "=", 2)
|
||||
if splits[0] == exposedEnv {
|
||||
handler.envs[strings.ToLower(exposedEnv)] = splits[1]
|
||||
if envVar != "" {
|
||||
splits := strings.SplitN(envVar, "=", 2)
|
||||
if len(splits) == 2 && splits[0] == exposedEnv {
|
||||
handler.envs[strings.ToLower(exposedEnv)] = splits[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
vendor/github.com/google/cadvisor/devicemapper/util.go
generated
vendored
15
vendor/github.com/google/cadvisor/devicemapper/util.go
generated
vendored
@@ -22,15 +22,11 @@ import (
|
||||
// ThinLsBinaryPresent returns the location of the thin_ls binary in the mount
|
||||
// namespace cadvisor is running in or an error. The locations checked are:
|
||||
//
|
||||
// - /sbin/
|
||||
// - /bin/
|
||||
// - /usr/sbin/
|
||||
// - /usr/bin/
|
||||
//
|
||||
// ThinLsBinaryPresent checks these paths relative to:
|
||||
//
|
||||
// 1. For non-containerized operation - `/`
|
||||
// 2. For containerized operation - `/rootfs`
|
||||
//
|
||||
// The thin_ls binary is provided by the device-mapper-persistent-data
|
||||
// package.
|
||||
func ThinLsBinaryPresent() (string, error) {
|
||||
@@ -39,7 +35,7 @@ func ThinLsBinaryPresent() (string, error) {
|
||||
err error
|
||||
)
|
||||
|
||||
for _, path := range []string{"/bin", "/usr/sbin/", "/usr/bin"} {
|
||||
for _, path := range []string{"/sbin", "/bin", "/usr/sbin/", "/usr/bin"} {
|
||||
// try paths for non-containerized operation
|
||||
// note: thin_ls is most likely a symlink to pdata_tools
|
||||
thinLsPath = filepath.Join(path, "thin_ls")
|
||||
@@ -47,13 +43,6 @@ func ThinLsBinaryPresent() (string, error) {
|
||||
if err == nil {
|
||||
return thinLsPath, nil
|
||||
}
|
||||
|
||||
// try paths for containerized operation
|
||||
thinLsPath = filepath.Join("/rootfs", thinLsPath)
|
||||
_, err = os.Stat(thinLsPath)
|
||||
if err == nil {
|
||||
return thinLsPath, nil
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("unable to find thin_ls binary")
|
||||
|
Reference in New Issue
Block a user