secretNames contacts the API to get a list of secret names. In case of an error, an empty list is returned.
(dockerCLI completion.APIClientProvider, cmd *cobra.Command)
| 253 | // secretNames contacts the API to get a list of secret names. |
| 254 | // In case of an error, an empty list is returned. |
| 255 | func secretNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { |
| 256 | res, err := dockerCLI.Client().SecretList(cmd.Context(), client.SecretListOptions{}) |
| 257 | if err != nil { |
| 258 | return []string{} |
| 259 | } |
| 260 | names := make([]string, 0, len(res.Items)) |
| 261 | for _, v := range res.Items { |
| 262 | names = append(names, v.Spec.Name) |
| 263 | } |
| 264 | return names |
| 265 | } |
| 266 | |
| 267 | // serviceNames contacts the API to get a list of service names. |
| 268 | // In case of an error, an empty list is returned. |
no test coverage detected
searching dependent graphs…