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

Function ListContainers

lib/container/common/helpers.go:352–370  ·  view source on GitHub ↗
(name string, cgroupPaths map[string]string, listType container.ListType)

Source from the content-addressed store, hash-verified

350}
351
352func ListContainers(name string, cgroupPaths map[string]string, listType container.ListType) ([]info.ContainerReference, error) {
353 containers := make(map[string]struct{})
354 for _, cgroupPath := range cgroupPaths {
355 err := ListDirectories(cgroupPath, name, listType == container.ListRecursive, containers)
356 if err != nil {
357 return nil, err
358 }
359 }
360
361 // Make into container references.
362 ret := make([]info.ContainerReference, 0, len(containers))
363 for cont := range containers {
364 ret = append(ret, info.ContainerReference{
365 Name: cont,
366 })
367 }
368
369 return ret, nil
370}
371
372// AssignDeviceNamesToDiskStats assigns the Device field on the provided DiskIoStats by looking up
373// the device major and minor identifiers in the provided device namer.

Callers 1

ListContainersMethod · 0.92

Calls 1

ListDirectoriesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…