28
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
28
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
@@ -43,6 +43,7 @@ const (
|
||||
LabelSystemRoot = "root"
|
||||
LabelDockerImages = "docker-images"
|
||||
LabelCrioImages = "crio-images"
|
||||
LabelCrioContainers = "crio-containers"
|
||||
DriverStatusPoolName = "Pool Name"
|
||||
DriverStatusDataLoopFile = "Data loop file"
|
||||
)
|
||||
@@ -295,14 +296,37 @@ func (i *RealFsInfo) addDockerImagesLabel(context Context, mounts []*mount.Info)
|
||||
}
|
||||
|
||||
func (i *RealFsInfo) addCrioImagesLabel(context Context, mounts []*mount.Info) {
|
||||
labelCrioImageOrContainers := LabelCrioContainers
|
||||
// If imagestore is not specified, let's fall back to the original case.
|
||||
// Everything will be stored in crio-images
|
||||
if context.Crio.ImageStore == "" {
|
||||
labelCrioImageOrContainers = LabelCrioImages
|
||||
}
|
||||
if context.Crio.Root != "" {
|
||||
crioPath := context.Crio.Root
|
||||
crioImagePaths := map[string]struct{}{
|
||||
"/": {},
|
||||
}
|
||||
for _, dir := range []string{"devicemapper", "btrfs", "aufs", "overlay", "zfs"} {
|
||||
crioImagePaths[path.Join(crioPath, dir+"-images")] = struct{}{}
|
||||
imageOrContainerPath := context.Crio.Driver + "-containers"
|
||||
if context.Crio.ImageStore == "" {
|
||||
// If ImageStore is not specified then we will assume ImageFs is complete separate.
|
||||
// No need to split the image store.
|
||||
imageOrContainerPath = context.Crio.Driver + "-images"
|
||||
|
||||
}
|
||||
crioImagePaths[path.Join(crioPath, imageOrContainerPath)] = struct{}{}
|
||||
for crioPath != "/" && crioPath != "." {
|
||||
crioImagePaths[crioPath] = struct{}{}
|
||||
crioPath = filepath.Dir(crioPath)
|
||||
}
|
||||
i.updateContainerImagesPath(labelCrioImageOrContainers, mounts, crioImagePaths)
|
||||
}
|
||||
if context.Crio.ImageStore != "" {
|
||||
crioPath := context.Crio.ImageStore
|
||||
crioImagePaths := map[string]struct{}{
|
||||
"/": {},
|
||||
}
|
||||
crioImagePaths[path.Join(crioPath, context.Crio.Driver+"-images")] = struct{}{}
|
||||
for crioPath != "/" && crioPath != "." {
|
||||
crioImagePaths[crioPath] = struct{}{}
|
||||
crioPath = filepath.Dir(crioPath)
|
||||
|
||||
Reference in New Issue
Block a user