(cmd *cobra.Command, args []string, toComplete string)
| 82 | } |
| 83 | |
| 84 | func NamespaceNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 85 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
| 86 | if err != nil { |
| 87 | return nil, cobra.ShellCompDirectiveError |
| 88 | } |
| 89 | if rootlessutil.IsRootlessParent() { |
| 90 | _ = rootlessutil.ParentMain(globalOptions.HostGatewayIP) |
| 91 | return nil, cobra.ShellCompDirectiveNoFileComp |
| 92 | } |
| 93 | |
| 94 | client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address) |
| 95 | if err != nil { |
| 96 | return nil, cobra.ShellCompDirectiveError |
| 97 | } |
| 98 | defer cancel() |
| 99 | nsService := client.NamespaceService() |
| 100 | nsList, err := nsService.List(ctx) |
| 101 | if err != nil { |
| 102 | log.L.Warn(err) |
| 103 | return nil, cobra.ShellCompDirectiveError |
| 104 | } |
| 105 | var candidates []string |
| 106 | candidates = append(candidates, nsList...) |
| 107 | return candidates, cobra.ShellCompDirectiveNoFileComp |
| 108 | } |
| 109 | |
| 110 | func SnapshotterNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 111 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
nothing calls this directly
no test coverage detected
searching dependent graphs…