configNames contacts the API to get a list of config names. In case of an error, an empty list is returned.
(dockerCLI completion.APIClientProvider, cmd *cobra.Command)
| 163 | // configNames contacts the API to get a list of config names. |
| 164 | // In case of an error, an empty list is returned. |
| 165 | func configNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { |
| 166 | res, err := dockerCLI.Client().ConfigList(cmd.Context(), client.ConfigListOptions{}) |
| 167 | if err != nil { |
| 168 | return []string{} |
| 169 | } |
| 170 | names := make([]string, 0, len(res.Items)) |
| 171 | for _, v := range res.Items { |
| 172 | names = append(names, v.Spec.Name) |
| 173 | } |
| 174 | return names |
| 175 | } |
| 176 | |
| 177 | // containerNames contacts the API to get names and optionally IDs of containers. |
| 178 | // In case of an error, an empty list is returned. |
no test coverage detected
searching dependent graphs…