MCPcopy
hub / github.com/dgraph-io/dgraph / AllContainers

Function AllContainers

testutil/docker.go:198–216  ·  view source on GitHub ↗
(prefix string)

Source from the content-addressed store, hash-verified

196}
197
198func AllContainers(prefix string) []container.Summary {
199 cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
200 x.Check(err)
201
202 containers, err := cli.ContainerList(context.Background(), container.ListOptions{All: true})
203 if err != nil {
204 log.Fatalf("While listing container: %v\n", err)
205 }
206
207 var out []container.Summary
208 for _, c := range containers {
209 for _, name := range c.Names {
210 if strings.HasPrefix(name, "/"+prefix) {
211 out = append(out, c)
212 }
213 }
214 }
215 return out
216}
217
218func ContainerAddrWithHost(name string, privatePort uint16, host string) string {
219 c := getContainer(name)

Callers 4

outputLogsFunction · 0.92
stopClusterFunction · 0.92
removeAllTestContainersFunction · 0.92
GetContainerMethod · 0.85

Calls 2

CheckFunction · 0.92
FatalfMethod · 0.80

Tested by

no test coverage detected