MCPcopy
hub / github.com/google/cadvisor / getAllNamespacedContainers

Method getAllNamespacedContainers

lib/manager/manager.go:570–584  ·  view source on GitHub ↗
(ns string)

Source from the content-addressed store, hash-verified

568}
569
570func (m *manager) getAllNamespacedContainers(ns string) map[string]*containerData {
571 containers := make(map[string]*containerData)
572
573 // Get containers in a namespace.
574 m.containers.Range(func(name namespacedContainerName, cont *containerData) bool {
575 if cont == nil {
576 return true
577 }
578 if name.Namespace == ns {
579 containers[cont.info.Name] = cont
580 }
581 return true
582 })
583 return containers
584}
585
586func (m *manager) namespacedContainer(containerName string, ns string) (*containerData, error) {
587 // Check for the container in the namespace.

Callers 3

AllDockerContainersMethod · 0.95
AllPodmanContainersMethod · 0.95

Calls 1

RangeMethod · 0.80

Tested by

no test coverage detected