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

Function imageInspectAction

cmd/nerdctl/image/image_inspect.go:89–112  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

87}
88
89func imageInspectAction(cmd *cobra.Command, args []string) error {
90 options, err := InspectOptions(cmd, nil)
91 if err != nil {
92 return err
93 }
94
95 // Verify we have a valid mode
96 if options.Mode != "native" && options.Mode != "dockercompat" {
97 return fmt.Errorf("unknown mode %q", options.Mode)
98 }
99
100 client, ctx, cancel, err := clientutil.NewClientWithPlatform(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address, options.Platform)
101 if err != nil {
102 return err
103 }
104 defer cancel()
105
106 entries, err := image.Inspect(ctx, client, args, options)
107 if err != nil {
108 return err
109 }
110
111 return formatter.FormatInspectSlice(options.Format, options.Stdout, entries)
112}
113
114func imageInspectShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
115 // show image names

Callers

nothing calls this directly

Calls 4

NewClientWithPlatformFunction · 0.92
InspectFunction · 0.92
FormatInspectSliceFunction · 0.92
InspectOptionsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…