pluginNames contacts the API to get a list of plugin names. In case of an error, an empty list is returned.
(dockerCLI completion.APIClientProvider, cmd *cobra.Command)
| 239 | // pluginNames contacts the API to get a list of plugin names. |
| 240 | // In case of an error, an empty list is returned. |
| 241 | func pluginNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { |
| 242 | res, err := dockerCLI.Client().PluginList(cmd.Context(), client.PluginListOptions{}) |
| 243 | if err != nil { |
| 244 | return []string{} |
| 245 | } |
| 246 | names := make([]string, 0, len(res.Items)) |
| 247 | for _, v := range res.Items { |
| 248 | names = append(names, v.Name) |
| 249 | } |
| 250 | return names |
| 251 | } |
| 252 | |
| 253 | // secretNames contacts the API to get a list of secret names. |
| 254 | // In case of an error, an empty list is returned. |
no test coverage detected
searching dependent graphs…