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

Function imageNames

cli/command/system/completion.go:199–209  ·  view source on GitHub ↗

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

197// imageNames contacts the API to get a list of image names.
198// In case of an error, an empty list is returned.
199func imageNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string {
200 res, err := dockerCLI.Client().ImageList(cmd.Context(), client.ImageListOptions{})
201 if err != nil {
202 return []string{}
203 }
204 names := make([]string, 0, len(res.Items))
205 for _, img := range res.Items {
206 names = append(names, img.RepoTags...)
207 }
208 return names
209}
210
211// networkNames contacts the API to get a list of network names.
212// In case of an error, an empty list is returned.

Callers 2

completeEventFiltersFunction · 0.85
completeObjectNamesFunction · 0.85

Calls 2

ClientMethod · 0.65
ImageListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…