MCPcopy
hub / github.com/containers/toolbox / getContainers

Function getContainers

src/cmd/list.go:113–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111}
112
113func getContainers() ([]podman.Container, error) {
114 logrus.Debug("Fetching all containers")
115 args := []string{"--all", "--sort", "names"}
116 containers, err := podman.GetContainers(args...)
117 if err != nil {
118 logrus.Debugf("Fetching all containers failed: %s", err)
119 return nil, errors.New("failed to get containers")
120 }
121
122 var toolboxContainers []podman.Container
123
124 for containers.Next() {
125 if container := containers.Get(); container.IsToolbx() {
126 toolboxContainers = append(toolboxContainers, container)
127 }
128 }
129
130 return toolboxContainers, nil
131}
132
133func listHelp(cmd *cobra.Command, args []string) {
134 if utils.IsInsideContainer() {

Callers 5

completionContainerNamesFunction · 0.85
runCommandFunction · 0.85
rmFunction · 0.85
listFunction · 0.85

Calls 3

NextMethod · 0.80
GetMethod · 0.80
IsToolbxMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…