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

Function InspectOptions

cmd/nerdctl/image/image_inspect.go:60–87  ·  view source on GitHub ↗
(cmd *cobra.Command, platform *string)

Source from the content-addressed store, hash-verified

58}
59
60func InspectOptions(cmd *cobra.Command, platform *string) (types.ImageInspectOptions, error) {
61 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
62 if err != nil {
63 return types.ImageInspectOptions{}, err
64 }
65 mode, err := cmd.Flags().GetString("mode")
66 if err != nil {
67 return types.ImageInspectOptions{}, err
68 }
69 format, err := cmd.Flags().GetString("format")
70 if err != nil {
71 return types.ImageInspectOptions{}, err
72 }
73 if platform == nil {
74 tempPlatform, err := cmd.Flags().GetString("platform")
75 if err != nil {
76 return types.ImageInspectOptions{}, err
77 }
78 platform = &tempPlatform
79 }
80 return types.ImageInspectOptions{
81 GOptions: globalOptions,
82 Mode: mode,
83 Format: format,
84 Platform: *platform,
85 Stdout: cmd.OutOrStdout(),
86 }, nil
87}
88
89func imageInspectAction(cmd *cobra.Command, args []string) error {
90 options, err := InspectOptions(cmd, nil)

Callers 1

imageInspectActionFunction · 0.70

Calls 1

ProcessRootCmdFlagsFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…