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

Function configNames

cli/command/system/completion.go:165–175  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

163// configNames contacts the API to get a list of config names.
164// In case of an error, an empty list is returned.
165func 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.

Callers 1

completeObjectNamesFunction · 0.85

Calls 2

ClientMethod · 0.65
ConfigListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…