(name string)
| 175 | } |
| 176 | |
| 177 | func getContainer(name string) container.Summary { |
| 178 | cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) |
| 179 | x.Check(err) |
| 180 | |
| 181 | containers, err := cli.ContainerList(context.Background(), container.ListOptions{All: true}) |
| 182 | if err != nil { |
| 183 | log.Fatalf("While listing container: %v\n", err) |
| 184 | } |
| 185 | |
| 186 | q := fmt.Sprintf("/%s_%s_", DockerPrefix, name) |
| 187 | for _, c := range containers { |
| 188 | for _, n := range c.Names { |
| 189 | if !strings.HasPrefix(n, q) { |
| 190 | continue |
| 191 | } |
| 192 | return c |
| 193 | } |
| 194 | } |
| 195 | return container.Summary{} |
| 196 | } |
| 197 | |
| 198 | func AllContainers(prefix string) []container.Summary { |
| 199 | cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) |
no test coverage detected