(cmd *cobra.Command)
| 34 | ) |
| 35 | |
| 36 | func 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 | |
| 59 | func ContainerNames(cmd *cobra.Command, filterFunc func(containerd.ProcessStatus) bool) ([]string, cobra.ShellCompDirective) { |
| 60 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
no test coverage detected
searching dependent graphs…