mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-15 03:29:39 +00:00
bump(github.com/google/cadvisor): cda62a43857256fbc95dd31e7c810888f00f8ec7
This commit is contained in:
24
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
24
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
@@ -43,6 +43,7 @@ const (
|
||||
LabelSystemRoot = "root"
|
||||
LabelDockerImages = "docker-images"
|
||||
LabelRktImages = "rkt-images"
|
||||
LabelCrioImages = "crio-images"
|
||||
)
|
||||
|
||||
// The maximum number of `du` and `find` tasks that can be running at once.
|
||||
@@ -91,6 +92,7 @@ type Context struct {
|
||||
// docker root directory.
|
||||
Docker DockerContext
|
||||
RktPath string
|
||||
Crio CrioContext
|
||||
}
|
||||
|
||||
type DockerContext struct {
|
||||
@@ -99,6 +101,10 @@ type DockerContext struct {
|
||||
DriverStatus map[string]string
|
||||
}
|
||||
|
||||
type CrioContext struct {
|
||||
Root string
|
||||
}
|
||||
|
||||
func NewFsInfo(context Context) (FsInfo, error) {
|
||||
mounts, err := mount.GetMounts()
|
||||
if err != nil {
|
||||
@@ -128,6 +134,7 @@ func NewFsInfo(context Context) (FsInfo, error) {
|
||||
// need to call this before the log line below printing out the partitions, as this function may
|
||||
// add a "partition" for devicemapper to fsInfo.partitions
|
||||
fsInfo.addDockerImagesLabel(context, mounts)
|
||||
fsInfo.addCrioImagesLabel(context, mounts)
|
||||
|
||||
glog.Infof("Filesystem UUIDs: %+v", fsInfo.fsUUIDToDeviceName)
|
||||
glog.Infof("Filesystem partitions: %+v", fsInfo.partitions)
|
||||
@@ -278,6 +285,23 @@ func (self *RealFsInfo) addDockerImagesLabel(context Context, mounts []*mount.In
|
||||
}
|
||||
}
|
||||
|
||||
func (self *RealFsInfo) addCrioImagesLabel(context Context, mounts []*mount.Info) {
|
||||
if context.Crio.Root != "" {
|
||||
crioPath := context.Crio.Root
|
||||
crioImagePaths := map[string]struct{}{
|
||||
"/": {},
|
||||
}
|
||||
for _, dir := range []string{"overlay", "overlay2"} {
|
||||
crioImagePaths[path.Join(crioPath, dir+"-images")] = struct{}{}
|
||||
}
|
||||
for crioPath != "/" && crioPath != "." {
|
||||
crioImagePaths[crioPath] = struct{}{}
|
||||
crioPath = filepath.Dir(crioPath)
|
||||
}
|
||||
self.updateContainerImagesPath(LabelCrioImages, mounts, crioImagePaths)
|
||||
}
|
||||
}
|
||||
|
||||
func (self *RealFsInfo) addRktImagesLabel(context Context, mounts []*mount.Info) {
|
||||
if context.RktPath != "" {
|
||||
rktPath := context.RktPath
|
||||
|
Reference in New Issue
Block a user