Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
21fd3c5c
Commit
21fd3c5c
authored
Jun 11, 2018
by
David Ashpole
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update cadvisor godeps to v0.30.1 to revert cadvisor#1916
parent
e6f64d0a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
127 additions
and
125 deletions
+127
-125
Godeps.json
Godeps/Godeps.json
+86
-86
BUILD
vendor/github.com/google/cadvisor/container/common/BUILD
+2
-2
helpers.go
...or/github.com/google/cadvisor/container/common/helpers.go
+1
-1
inotify_watcher.go
...b.com/google/cadvisor/container/common/inotify_watcher.go
+21
-21
factory.go
vendor/github.com/google/cadvisor/container/raw/factory.go
+3
-3
handler.go
vendor/github.com/google/cadvisor/container/raw/handler.go
+1
-1
BUILD
vendor/github.com/google/cadvisor/manager/watcher/raw/BUILD
+1
-1
raw.go
vendor/github.com/google/cadvisor/manager/watcher/raw/raw.go
+12
-10
No files found.
Godeps/Godeps.json
View file @
21fd3c5c
...
@@ -1508,218 +1508,218 @@
...
@@ -1508,218 +1508,218 @@
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/accelerators"
,
"ImportPath"
:
"github.com/google/cadvisor/accelerators"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/api"
,
"ImportPath"
:
"github.com/google/cadvisor/api"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/cache/memory"
,
"ImportPath"
:
"github.com/google/cadvisor/cache/memory"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/client/v2"
,
"ImportPath"
:
"github.com/google/cadvisor/client/v2"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/collector"
,
"ImportPath"
:
"github.com/google/cadvisor/collector"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container"
,
"ImportPath"
:
"github.com/google/cadvisor/container"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/common"
,
"ImportPath"
:
"github.com/google/cadvisor/container/common"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/containerd"
,
"ImportPath"
:
"github.com/google/cadvisor/container/containerd"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/crio"
,
"ImportPath"
:
"github.com/google/cadvisor/container/crio"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/docker"
,
"ImportPath"
:
"github.com/google/cadvisor/container/docker"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/libcontainer"
,
"ImportPath"
:
"github.com/google/cadvisor/container/libcontainer"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/raw"
,
"ImportPath"
:
"github.com/google/cadvisor/container/raw"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/rkt"
,
"ImportPath"
:
"github.com/google/cadvisor/container/rkt"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container/systemd"
,
"ImportPath"
:
"github.com/google/cadvisor/container/systemd"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/devicemapper"
,
"ImportPath"
:
"github.com/google/cadvisor/devicemapper"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/events"
,
"ImportPath"
:
"github.com/google/cadvisor/events"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/fs"
,
"ImportPath"
:
"github.com/google/cadvisor/fs"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/healthz"
,
"ImportPath"
:
"github.com/google/cadvisor/healthz"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/http"
,
"ImportPath"
:
"github.com/google/cadvisor/http"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/http/mux"
,
"ImportPath"
:
"github.com/google/cadvisor/http/mux"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/info/v1"
,
"ImportPath"
:
"github.com/google/cadvisor/info/v1"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/info/v2"
,
"ImportPath"
:
"github.com/google/cadvisor/info/v2"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/machine"
,
"ImportPath"
:
"github.com/google/cadvisor/machine"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/manager"
,
"ImportPath"
:
"github.com/google/cadvisor/manager"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher"
,
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/raw"
,
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/raw"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/rkt"
,
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/rkt"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/metrics"
,
"ImportPath"
:
"github.com/google/cadvisor/metrics"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/pages"
,
"ImportPath"
:
"github.com/google/cadvisor/pages"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/pages/static"
,
"ImportPath"
:
"github.com/google/cadvisor/pages/static"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/storage"
,
"ImportPath"
:
"github.com/google/cadvisor/storage"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/summary"
,
"ImportPath"
:
"github.com/google/cadvisor/summary"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils"
,
"ImportPath"
:
"github.com/google/cadvisor/utils"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cloudinfo"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/cloudinfo"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload/netlink"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload/netlink"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/docker"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/docker"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/oomparser"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/oomparser"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/sysfs"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/sysfs"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils/sysinfo"
,
"ImportPath"
:
"github.com/google/cadvisor/utils/sysinfo"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/validate"
,
"ImportPath"
:
"github.com/google/cadvisor/validate"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/version"
,
"ImportPath"
:
"github.com/google/cadvisor/version"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/zfs"
,
"ImportPath"
:
"github.com/google/cadvisor/zfs"
,
"Comment"
:
"v0.30.
0
"
,
"Comment"
:
"v0.30.
1
"
,
"Rev"
:
"
f6359ffcbdec3c228bf312e6939ea6edf556ce52
"
"Rev"
:
"
49c4fae21f151168b09758b7da1968fed8cd56a0
"
},
},
{
{
"ImportPath"
:
"github.com/google/certificate-transparency-go"
,
"ImportPath"
:
"github.com/google/certificate-transparency-go"
,
...
...
vendor/github.com/google/cadvisor/container/common/BUILD
View file @
21fd3c5c
...
@@ -5,18 +5,18 @@ go_library(
...
@@ -5,18 +5,18 @@ go_library(
srcs = [
srcs = [
"container_hints.go",
"container_hints.go",
"fsHandler.go",
"fsHandler.go",
"fsnotify_watcher.go",
"helpers.go",
"helpers.go",
"inotify_watcher.go",
],
],
importpath = "github.com/google/cadvisor/container/common",
importpath = "github.com/google/cadvisor/container/common",
visibility = ["//visibility:public"],
visibility = ["//visibility:public"],
deps = [
deps = [
"//vendor/github.com/fsnotify/fsnotify:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/cadvisor/container:go_default_library",
"//vendor/github.com/google/cadvisor/container:go_default_library",
"//vendor/github.com/google/cadvisor/fs:go_default_library",
"//vendor/github.com/google/cadvisor/fs:go_default_library",
"//vendor/github.com/google/cadvisor/info/v1:go_default_library",
"//vendor/github.com/google/cadvisor/info/v1:go_default_library",
"//vendor/github.com/google/cadvisor/utils:go_default_library",
"//vendor/github.com/google/cadvisor/utils:go_default_library",
"//vendor/golang.org/x/exp/inotify:go_default_library",
],
],
)
)
...
...
vendor/github.com/google/cadvisor/container/common/helpers.go
View file @
21fd3c5c
...
@@ -40,7 +40,7 @@ func DebugInfo(watches map[string][]string) map[string][]string {
...
@@ -40,7 +40,7 @@ func DebugInfo(watches map[string][]string) map[string][]string {
lines
=
append
(
lines
,
fmt
.
Sprintf
(
"
\t
%s"
,
cg
))
lines
=
append
(
lines
,
fmt
.
Sprintf
(
"
\t
%s"
,
cg
))
}
}
}
}
out
[
"
Fs
notify watches"
]
=
lines
out
[
"
I
notify watches"
]
=
lines
return
out
return
out
}
}
...
...
vendor/github.com/google/cadvisor/container/common/
fs
notify_watcher.go
→
vendor/github.com/google/cadvisor/container/common/
i
notify_watcher.go
View file @
21fd3c5c
...
@@ -17,15 +17,15 @@ package common
...
@@ -17,15 +17,15 @@ package common
import
(
import
(
"sync"
"sync"
"g
ithub.com/fsnotify/fs
notify"
"g
olang.org/x/exp/i
notify"
)
)
// Watcher for container-related
fs
notify events in the cgroup hierarchy.
// Watcher for container-related
i
notify events in the cgroup hierarchy.
//
//
// Implementation is thread-safe.
// Implementation is thread-safe.
type
Fs
notifyWatcher
struct
{
type
I
notifyWatcher
struct
{
// Underlying
fs
notify watcher.
// Underlying
i
notify watcher.
watcher
*
fs
notify
.
Watcher
watcher
*
i
notify
.
Watcher
// Map of containers being watched to cgroup paths watched for that container.
// Map of containers being watched to cgroup paths watched for that container.
containersWatched
map
[
string
]
map
[
string
]
bool
containersWatched
map
[
string
]
map
[
string
]
bool
...
@@ -34,28 +34,28 @@ type FsnotifyWatcher struct {
...
@@ -34,28 +34,28 @@ type FsnotifyWatcher struct {
lock
sync
.
Mutex
lock
sync
.
Mutex
}
}
func
New
FsnotifyWatcher
()
(
*
Fs
notifyWatcher
,
error
)
{
func
New
InotifyWatcher
()
(
*
I
notifyWatcher
,
error
)
{
w
,
err
:=
fs
notify
.
NewWatcher
()
w
,
err
:=
i
notify
.
NewWatcher
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
&
Fs
notifyWatcher
{
return
&
I
notifyWatcher
{
watcher
:
w
,
watcher
:
w
,
containersWatched
:
make
(
map
[
string
]
map
[
string
]
bool
),
containersWatched
:
make
(
map
[
string
]
map
[
string
]
bool
),
},
nil
},
nil
}
}
// Add a watch to the specified directory. Returns if the container was already being watched.
// Add a watch to the specified directory. Returns if the container was already being watched.
func
(
iw
*
Fs
notifyWatcher
)
AddWatch
(
containerName
,
dir
string
)
(
bool
,
error
)
{
func
(
iw
*
I
notifyWatcher
)
AddWatch
(
containerName
,
dir
string
)
(
bool
,
error
)
{
iw
.
lock
.
Lock
()
iw
.
lock
.
Lock
()
defer
iw
.
lock
.
Unlock
()
defer
iw
.
lock
.
Unlock
()
cgroupsWatched
,
alreadyWatched
:=
iw
.
containersWatched
[
containerName
]
cgroupsWatched
,
alreadyWatched
:=
iw
.
containersWatched
[
containerName
]
// Register an
fs
notify notification.
// Register an
i
notify notification.
if
!
cgroupsWatched
[
dir
]
{
if
!
cgroupsWatched
[
dir
]
{
err
:=
iw
.
watcher
.
Add
(
dir
)
err
:=
iw
.
watcher
.
Add
Watch
(
dir
,
inotify
.
IN_CREATE
|
inotify
.
IN_DELETE
|
inotify
.
IN_MOVE
)
if
err
!=
nil
{
if
err
!=
nil
{
return
alreadyWatched
,
err
return
alreadyWatched
,
err
}
}
...
@@ -74,7 +74,7 @@ func (iw *FsnotifyWatcher) AddWatch(containerName, dir string) (bool, error) {
...
@@ -74,7 +74,7 @@ func (iw *FsnotifyWatcher) AddWatch(containerName, dir string) (bool, error) {
}
}
// Remove watch from the specified directory. Returns if this was the last watch on the specified container.
// Remove watch from the specified directory. Returns if this was the last watch on the specified container.
func
(
iw
*
Fs
notifyWatcher
)
RemoveWatch
(
containerName
,
dir
string
)
(
bool
,
error
)
{
func
(
iw
*
I
notifyWatcher
)
RemoveWatch
(
containerName
,
dir
string
)
(
bool
,
error
)
{
iw
.
lock
.
Lock
()
iw
.
lock
.
Lock
()
defer
iw
.
lock
.
Unlock
()
defer
iw
.
lock
.
Unlock
()
...
@@ -84,9 +84,9 @@ func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
...
@@ -84,9 +84,9 @@ func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
return
false
,
nil
return
false
,
nil
}
}
// Remove the
fs
notify watch if it exists.
// Remove the
i
notify watch if it exists.
if
cgroupsWatched
[
dir
]
{
if
cgroupsWatched
[
dir
]
{
err
:=
iw
.
watcher
.
Remove
(
dir
)
err
:=
iw
.
watcher
.
Remove
Watch
(
dir
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
nil
return
false
,
nil
}
}
...
@@ -103,22 +103,22 @@ func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
...
@@ -103,22 +103,22 @@ func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
}
}
// Errors are returned on this channel.
// Errors are returned on this channel.
func
(
iw
*
Fs
notifyWatcher
)
Error
()
chan
error
{
func
(
iw
*
I
notifyWatcher
)
Error
()
chan
error
{
return
iw
.
watcher
.
Error
s
return
iw
.
watcher
.
Error
}
}
// Events are returned on this channel.
// Events are returned on this channel.
func
(
iw
*
FsnotifyWatcher
)
Event
()
chan
fs
notify
.
Event
{
func
(
iw
*
InotifyWatcher
)
Event
()
chan
*
i
notify
.
Event
{
return
iw
.
watcher
.
Event
s
return
iw
.
watcher
.
Event
}
}
// Closes the
fs
notify watcher.
// Closes the
i
notify watcher.
func
(
iw
*
Fs
notifyWatcher
)
Close
()
error
{
func
(
iw
*
I
notifyWatcher
)
Close
()
error
{
return
iw
.
watcher
.
Close
()
return
iw
.
watcher
.
Close
()
}
}
// Returns a map of containers to the cgroup paths being watched.
// Returns a map of containers to the cgroup paths being watched.
func
(
iw
*
Fs
notifyWatcher
)
GetWatches
()
map
[
string
][]
string
{
func
(
iw
*
I
notifyWatcher
)
GetWatches
()
map
[
string
][]
string
{
out
:=
make
(
map
[
string
][]
string
,
len
(
iw
.
containersWatched
))
out
:=
make
(
map
[
string
][]
string
,
len
(
iw
.
containersWatched
))
for
k
,
v
:=
range
iw
.
containersWatched
{
for
k
,
v
:=
range
iw
.
containersWatched
{
out
[
k
]
=
mapToSlice
(
v
)
out
[
k
]
=
mapToSlice
(
v
)
...
...
vendor/github.com/google/cadvisor/container/raw/factory.go
View file @
21fd3c5c
...
@@ -40,8 +40,8 @@ type rawFactory struct {
...
@@ -40,8 +40,8 @@ type rawFactory struct {
// Information about mounted filesystems.
// Information about mounted filesystems.
fsInfo
fs
.
FsInfo
fsInfo
fs
.
FsInfo
// Watcher for
fs
notify events.
// Watcher for
i
notify events.
watcher
*
common
.
Fs
notifyWatcher
watcher
*
common
.
I
notifyWatcher
// List of metrics to be ignored.
// List of metrics to be ignored.
ignoreMetrics
map
[
container
.
MetricKind
]
struct
{}
ignoreMetrics
map
[
container
.
MetricKind
]
struct
{}
...
@@ -78,7 +78,7 @@ func Register(machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo, igno
...
@@ -78,7 +78,7 @@ func Register(machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo, igno
return
fmt
.
Errorf
(
"failed to find supported cgroup mounts for the raw factory"
)
return
fmt
.
Errorf
(
"failed to find supported cgroup mounts for the raw factory"
)
}
}
watcher
,
err
:=
common
.
New
Fs
notifyWatcher
()
watcher
,
err
:=
common
.
New
I
notifyWatcher
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
vendor/github.com/google/cadvisor/container/raw/handler.go
View file @
21fd3c5c
...
@@ -49,7 +49,7 @@ func isRootCgroup(name string) bool {
...
@@ -49,7 +49,7 @@ func isRootCgroup(name string) bool {
return
name
==
"/"
return
name
==
"/"
}
}
func
newRawContainerHandler
(
name
string
,
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
,
machineInfoFactory
info
.
MachineInfoFactory
,
fsInfo
fs
.
FsInfo
,
watcher
*
common
.
Fs
notifyWatcher
,
rootFs
string
,
ignoreMetrics
container
.
MetricSet
)
(
container
.
ContainerHandler
,
error
)
{
func
newRawContainerHandler
(
name
string
,
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
,
machineInfoFactory
info
.
MachineInfoFactory
,
fsInfo
fs
.
FsInfo
,
watcher
*
common
.
I
notifyWatcher
,
rootFs
string
,
ignoreMetrics
container
.
MetricSet
)
(
container
.
ContainerHandler
,
error
)
{
cgroupPaths
:=
common
.
MakeCgroupPaths
(
cgroupSubsystems
.
MountPoints
,
name
)
cgroupPaths
:=
common
.
MakeCgroupPaths
(
cgroupSubsystems
.
MountPoints
,
name
)
cHints
,
err
:=
common
.
GetContainerHintsFromFile
(
*
common
.
ArgContainerHints
)
cHints
,
err
:=
common
.
GetContainerHintsFromFile
(
*
common
.
ArgContainerHints
)
...
...
vendor/github.com/google/cadvisor/manager/watcher/raw/BUILD
View file @
21fd3c5c
...
@@ -6,11 +6,11 @@ go_library(
...
@@ -6,11 +6,11 @@ go_library(
importpath = "github.com/google/cadvisor/manager/watcher/raw",
importpath = "github.com/google/cadvisor/manager/watcher/raw",
visibility = ["//visibility:public"],
visibility = ["//visibility:public"],
deps = [
deps = [
"//vendor/github.com/fsnotify/fsnotify:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/google/cadvisor/container/common:go_default_library",
"//vendor/github.com/google/cadvisor/container/common:go_default_library",
"//vendor/github.com/google/cadvisor/container/libcontainer:go_default_library",
"//vendor/github.com/google/cadvisor/container/libcontainer:go_default_library",
"//vendor/github.com/google/cadvisor/manager/watcher:go_default_library",
"//vendor/github.com/google/cadvisor/manager/watcher:go_default_library",
"//vendor/golang.org/x/exp/inotify:go_default_library",
],
],
)
)
...
...
vendor/github.com/google/cadvisor/manager/watcher/raw/raw.go
View file @
21fd3c5c
...
@@ -27,8 +27,8 @@ import (
...
@@ -27,8 +27,8 @@ import (
"github.com/google/cadvisor/container/libcontainer"
"github.com/google/cadvisor/container/libcontainer"
"github.com/google/cadvisor/manager/watcher"
"github.com/google/cadvisor/manager/watcher"
"github.com/fsnotify/fsnotify"
"github.com/golang/glog"
"github.com/golang/glog"
"golang.org/x/exp/inotify"
)
)
type
rawContainerWatcher
struct
{
type
rawContainerWatcher
struct
{
...
@@ -37,8 +37,8 @@ type rawContainerWatcher struct {
...
@@ -37,8 +37,8 @@ type rawContainerWatcher struct {
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
//
Fs
notify event watcher.
//
I
notify event watcher.
watcher
*
common
.
Fs
notifyWatcher
watcher
*
common
.
I
notifyWatcher
// Signal for watcher thread to stop.
// Signal for watcher thread to stop.
stopWatcher
chan
error
stopWatcher
chan
error
...
@@ -53,7 +53,7 @@ func NewRawContainerWatcher() (watcher.ContainerWatcher, error) {
...
@@ -53,7 +53,7 @@ func NewRawContainerWatcher() (watcher.ContainerWatcher, error) {
return
nil
,
fmt
.
Errorf
(
"failed to find supported cgroup mounts for the raw factory"
)
return
nil
,
fmt
.
Errorf
(
"failed to find supported cgroup mounts for the raw factory"
)
}
}
watcher
,
err
:=
common
.
New
Fs
notifyWatcher
()
watcher
,
err
:=
common
.
New
I
notifyWatcher
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -121,7 +121,7 @@ func (self *rawContainerWatcher) watchDirectory(events chan watcher.ContainerEve
...
@@ -121,7 +121,7 @@ func (self *rawContainerWatcher) watchDirectory(events chan watcher.ContainerEve
if
cleanup
{
if
cleanup
{
_
,
err
:=
self
.
watcher
.
RemoveWatch
(
containerName
,
dir
)
_
,
err
:=
self
.
watcher
.
RemoveWatch
(
containerName
,
dir
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"Failed to remove
fs
notify watch for %q: %v"
,
dir
,
err
)
glog
.
Warningf
(
"Failed to remove
i
notify watch for %q: %v"
,
dir
,
err
)
}
}
}
}
}()
}()
...
@@ -163,16 +163,18 @@ func (self *rawContainerWatcher) watchDirectory(events chan watcher.ContainerEve
...
@@ -163,16 +163,18 @@ func (self *rawContainerWatcher) watchDirectory(events chan watcher.ContainerEve
return
alreadyWatching
,
nil
return
alreadyWatching
,
nil
}
}
func
(
self
*
rawContainerWatcher
)
processEvent
(
event
fs
notify
.
Event
,
events
chan
watcher
.
ContainerEvent
)
error
{
func
(
self
*
rawContainerWatcher
)
processEvent
(
event
*
i
notify
.
Event
,
events
chan
watcher
.
ContainerEvent
)
error
{
// Convert the
fs
notify event type to a container create or delete.
// Convert the
i
notify event type to a container create or delete.
var
eventType
watcher
.
ContainerEventType
var
eventType
watcher
.
ContainerEventType
switch
{
switch
{
case
event
.
Op
==
fsnotify
.
Create
:
case
(
event
.
Mask
&
inotify
.
IN_CREATE
)
>
0
:
eventType
=
watcher
.
ContainerAdd
eventType
=
watcher
.
ContainerAdd
case
event
.
Op
==
fsnotify
.
Remove
:
case
(
event
.
Mask
&
inotify
.
IN_DELETE
)
>
0
:
eventType
=
watcher
.
ContainerDelete
eventType
=
watcher
.
ContainerDelete
case
event
.
Op
==
fsnotify
.
Rename
:
case
(
event
.
Mask
&
inotify
.
IN_MOVED_FROM
)
>
0
:
eventType
=
watcher
.
ContainerDelete
eventType
=
watcher
.
ContainerDelete
case
(
event
.
Mask
&
inotify
.
IN_MOVED_TO
)
>
0
:
eventType
=
watcher
.
ContainerAdd
default
:
default
:
// Ignore other events.
// Ignore other events.
return
nil
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment