(cmd *cobra.Command, args []string)
| 87 | } |
| 88 | |
| 89 | func 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 | |
| 114 | func imageInspectShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 115 | // show image names |
nothing calls this directly
no test coverage detected
searching dependent graphs…