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

Function volumeNames

cli/command/system/completion.go:307–317  ·  view source on GitHub ↗

volumeNames contacts the API to get a list of volume 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

305// volumeNames contacts the API to get a list of volume names.
306// In case of an error, an empty list is returned.
307func volumeNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string {
308 res, err := dockerCLI.Client().VolumeList(cmd.Context(), client.VolumeListOptions{})
309 if err != nil {
310 return []string{}
311 }
312 names := make([]string, 0, len(res.Items))
313 for _, v := range res.Items {
314 names = append(names, v.Name)
315 }
316 return names
317}
318
319// completeObjectNames completes names of objects based on the "--type" flag
320//

Callers 2

completeEventFiltersFunction · 0.85
completeObjectNamesFunction · 0.85

Calls 2

ClientMethod · 0.65
VolumeListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…