pinned cadvisor to a latest commit
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
This commit is contained in:
2
vendor/github.com/google/cadvisor/container/common/BUILD
generated
vendored
2
vendor/github.com/google/cadvisor/container/common/BUILD
generated
vendored
@@ -18,8 +18,8 @@ go_library(
|
||||
"//vendor/github.com/google/cadvisor/utils:go_default_library",
|
||||
"//vendor/github.com/karrick/godirwalk:go_default_library",
|
||||
"//vendor/github.com/pkg/errors:go_default_library",
|
||||
"//vendor/github.com/sigma/go-inotify:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
"//vendor/k8s.io/utils/inotify:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
11
vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
11
vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
@@ -116,6 +116,15 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF
|
||||
}
|
||||
}
|
||||
|
||||
// Processes, read it's value from pids path directly
|
||||
pidsRoot, ok := cgroupPaths["pids"]
|
||||
if ok {
|
||||
if utils.FileExists(pidsRoot) {
|
||||
spec.HasProcesses = true
|
||||
spec.Processes.Limit = readUInt64(pidsRoot, "pids.max")
|
||||
}
|
||||
}
|
||||
|
||||
spec.HasNetwork = hasNetwork
|
||||
spec.HasFilesystem = hasFilesystem
|
||||
|
||||
@@ -143,7 +152,7 @@ func readString(dirpath string, file string) string {
|
||||
|
||||
func readUInt64(dirpath string, file string) uint64 {
|
||||
out := readString(dirpath, file)
|
||||
if out == "" {
|
||||
if out == "" || out == "max" {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
4
vendor/github.com/google/cadvisor/container/common/inotify_watcher.go
generated
vendored
4
vendor/github.com/google/cadvisor/container/common/inotify_watcher.go
generated
vendored
@@ -17,7 +17,7 @@ package common
|
||||
import (
|
||||
"sync"
|
||||
|
||||
inotify "github.com/sigma/go-inotify"
|
||||
inotify "k8s.io/utils/inotify"
|
||||
)
|
||||
|
||||
// Watcher for container-related inotify events in the cgroup hierarchy.
|
||||
@@ -55,7 +55,7 @@ func (iw *InotifyWatcher) AddWatch(containerName, dir string) (bool, error) {
|
||||
|
||||
// Register an inotify notification.
|
||||
if !cgroupsWatched[dir] {
|
||||
err := iw.watcher.AddWatch(dir, inotify.IN_CREATE|inotify.IN_DELETE|inotify.IN_MOVE)
|
||||
err := iw.watcher.AddWatch(dir, inotify.InCreate|inotify.InDelete|inotify.InMove)
|
||||
if err != nil {
|
||||
return alreadyWatched, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user