(cmd *cobra.Command, args []string, toComplete string)
| 108 | } |
| 109 | |
| 110 | func SnapshotterNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 111 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
| 112 | if err != nil { |
| 113 | return nil, cobra.ShellCompDirectiveError |
| 114 | } |
| 115 | if rootlessutil.IsRootlessParent() { |
| 116 | _ = rootlessutil.ParentMain(globalOptions.HostGatewayIP) |
| 117 | return nil, cobra.ShellCompDirectiveNoFileComp |
| 118 | } |
| 119 | client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address) |
| 120 | if err != nil { |
| 121 | return nil, cobra.ShellCompDirectiveError |
| 122 | } |
| 123 | defer cancel() |
| 124 | snapshotterPlugins, err := infoutil.GetSnapshotterNames(ctx, client.IntrospectionService()) |
| 125 | if err != nil { |
| 126 | return nil, cobra.ShellCompDirectiveError |
| 127 | } |
| 128 | var candidates []string |
| 129 | candidates = append(candidates, snapshotterPlugins...) |
| 130 | return candidates, cobra.ShellCompDirectiveNoFileComp |
| 131 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…