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

Function SnapshotterNames

cmd/nerdctl/completion/completion_unix.go:110–131  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string, toComplete string)

Source from the content-addressed store, hash-verified

108}
109
110func 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}

Callers

nothing calls this directly

Calls 5

ProcessRootCmdFlagsFunction · 0.92
IsRootlessParentFunction · 0.92
ParentMainFunction · 0.92
NewClientFunction · 0.92
GetSnapshotterNamesFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…