MCPcopy Create free account
hub / github.com/containerd/nerdctl / ImageNames

Function ImageNames

cmd/nerdctl/completion/completion.go:36–57  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

34)
35
36func ImageNames(cmd *cobra.Command) ([]string, cobra.ShellCompDirective) {
37 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
38 if err != nil {
39 return nil, cobra.ShellCompDirectiveError
40 }
41 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address)
42 if err != nil {
43 return nil, cobra.ShellCompDirectiveError
44 }
45 defer cancel()
46
47 imageList, err := client.ImageService().List(ctx, "")
48
49 if err != nil {
50 return nil, cobra.ShellCompDirectiveError
51 }
52 candidates := []string{}
53 for _, img := range imageList {
54 candidates = append(candidates, img.Name)
55 }
56 return candidates, cobra.ShellCompDirectiveNoFileComp
57}
58
59func ContainerNames(cmd *cobra.Command, filterFunc func(containerd.ProcessStatus) bool) ([]string, cobra.ShellCompDirective) {
60 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)

Callers 15

runShellCompleteFunction · 0.92
rmiShellCompleteFunction · 0.92
imgcryptShellCompleteFunction · 0.92
tagShellCompleteFunction · 0.92
pushShellCompleteFunction · 0.92
saveShellCompleteFunction · 0.92
imageImportShellCompleteFunction · 0.92
imagesShellCompleteFunction · 0.92
historyShellCompleteFunction · 0.92
inspectShellCompleteFunction · 0.92

Calls 3

ProcessRootCmdFlagsFunction · 0.92
NewClientFunction · 0.92
ListMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…