Bump cAdvisor to v0.49.0

Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
David Porter
2024-02-29 14:21:49 -08:00
parent 0d50a398df
commit c05e541793
10 changed files with 52 additions and 17 deletions

View File

@@ -44,6 +44,7 @@ var (
type Info struct {
StorageDriver string `json:"storage_driver"`
StorageRoot string `json:"storage_root"`
StorageImage string `json:"storage_image"`
}
// ContainerInfo represents a given container information

View File

@@ -32,6 +32,9 @@ import (
// The namespace under which crio aliases are unique.
const CrioNamespace = "crio"
// The namespace suffix under which crio aliases are unique.
const CrioNamespaceSuffix = ".scope"
// The namespace systemd runs components under.
const SystemdNamespace = "system-systemd"
@@ -114,16 +117,21 @@ func (f *crioFactory) CanHandleAndAccept(name string) (bool, bool, error) {
// TODO(runcom): should we include crio-conmon cgroups?
return false, false, nil
}
if !strings.HasPrefix(path.Base(name), CrioNamespace) {
return false, false, nil
}
if strings.HasPrefix(path.Base(name), SystemdNamespace) {
return true, false, nil
}
if !strings.HasPrefix(path.Base(name), CrioNamespace) {
return false, false, nil
}
// if the container is not associated with CRI-O, we can't handle it or accept it.
if !isContainerName(name) {
return false, false, nil
}
if !strings.HasSuffix(path.Base(name), CrioNamespaceSuffix) {
// this mean it's a sandbox container
return true, false, nil
}
return true, true, nil
}

View File

@@ -40,7 +40,7 @@ func (p *plugin) InitializeFSContext(context *fs.Context) error {
if err != nil {
klog.V(5).Infof("CRI-O not connected: %v", err)
} else {
context.Crio = fs.CrioContext{Root: crioInfo.StorageRoot}
context.Crio = fs.CrioContext{Root: crioInfo.StorageRoot, ImageStore: crioInfo.StorageImage, Driver: crioInfo.StorageDriver}
}
return nil
}