daemonNames contacts the API to get name and ID of the current docker daemon. In case of an error, an empty list is returned.
(dockerCLI completion.APIClientProvider, cmd *cobra.Command)
| 187 | // daemonNames contacts the API to get name and ID of the current docker daemon. |
| 188 | // In case of an error, an empty list is returned. |
| 189 | func daemonNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { |
| 190 | res, err := dockerCLI.Client().Info(cmd.Context(), client.InfoOptions{}) |
| 191 | if err != nil { |
| 192 | return []string{} |
| 193 | } |
| 194 | return []string{res.Info.Name, res.Info.ID} |
| 195 | } |
| 196 | |
| 197 | // imageNames contacts the API to get a list of image names. |
| 198 | // In case of an error, an empty list is returned. |
no test coverage detected
searching dependent graphs…