1
vendor/github.com/google/cadvisor/container/crio/client.go
generated
vendored
1
vendor/github.com/google/cadvisor/container/crio/client.go
generated
vendored
@@ -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
|
||||
|
14
vendor/github.com/google/cadvisor/container/crio/factory.go
generated
vendored
14
vendor/github.com/google/cadvisor/container/crio/factory.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/google/cadvisor/container/crio/plugin.go
generated
vendored
2
vendor/github.com/google/cadvisor/container/crio/plugin.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user