MCPcopy Index your code
hub / github.com/docker/cli / secretNames

Function secretNames

cli/command/system/completion.go:255–265  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

253// secretNames contacts the API to get a list of secret names.
254// In case of an error, an empty list is returned.
255func 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.

Callers 1

completeObjectNamesFunction · 0.85

Calls 2

ClientMethod · 0.65
SecretListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…