imageNames contacts the API to get a list of image names. In case of an error, an empty list is returned.
(dockerCLI completion.APIClientProvider, cmd *cobra.Command)
| 197 | // imageNames contacts the API to get a list of image names. |
| 198 | // In case of an error, an empty list is returned. |
| 199 | func imageNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { |
| 200 | res, err := dockerCLI.Client().ImageList(cmd.Context(), client.ImageListOptions{}) |
| 201 | if err != nil { |
| 202 | return []string{} |
| 203 | } |
| 204 | names := make([]string, 0, len(res.Items)) |
| 205 | for _, img := range res.Items { |
| 206 | names = append(names, img.RepoTags...) |
| 207 | } |
| 208 | return names |
| 209 | } |
| 210 | |
| 211 | // networkNames contacts the API to get a list of network names. |
| 212 | // In case of an error, an empty list is returned. |
no test coverage detected
searching dependent graphs…