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

Function inspectAction

cmd/nerdctl/network/network_inspect.go:50–79  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

48}
49
50func inspectAction(cmd *cobra.Command, args []string) error {
51 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
52 if err != nil {
53 return err
54 }
55 mode, err := cmd.Flags().GetString("mode")
56 if err != nil {
57 return err
58 }
59 format, err := cmd.Flags().GetString("format")
60 if err != nil {
61 return err
62 }
63
64 options := types.NetworkInspectOptions{
65 GOptions: globalOptions,
66 Mode: mode,
67 Format: format,
68 Networks: args,
69 Stdout: cmd.OutOrStdout(),
70 }
71
72 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address)
73 if err != nil {
74 return err
75 }
76 defer cancel()
77
78 return network.Inspect(ctx, client, options)
79}
80
81func networkInspectShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
82 // show network names, including "bridge"

Callers

nothing calls this directly

Calls 3

ProcessRootCmdFlagsFunction · 0.92
NewClientFunction · 0.92
InspectFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…