MCPcopy Index your code
hub / github.com/containerd/containerd / ListContainers

Method ListContainers

internal/cri/nri/nri_api_linux.go:438–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436}
437
438func (a *API) ListContainers() []nri.Container {
439 containers := []nri.Container{}
440 for _, ctr := range a.cri.ContainerStore().List() {
441 switch ctr.Status.Get().State() {
442 case cri.ContainerState_CONTAINER_EXITED:
443 continue
444 case cri.ContainerState_CONTAINER_UNKNOWN:
445 continue
446 }
447 containers = append(containers, a.nriContainer(&ctr))
448 }
449 return containers
450}
451
452func (a *API) GetPodSandbox(id string) (nri.PodSandbox, bool) {
453 pod, err := a.cri.SandboxStore().Get(id)

Callers

nothing calls this directly

Calls 5

nriContainerMethod · 0.95
ListMethod · 0.65
ContainerStoreMethod · 0.65
StateMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected