| 11 | ) |
| 12 | |
| 13 | func main() { |
| 14 | plugin.Run(func(dockerCli command.Cli) *cobra.Command { |
| 15 | return &cobra.Command{ |
| 16 | Use: "nopersistentprerun", |
| 17 | Short: "Testing without PersistentPreRun hooks", |
| 18 | // PersistentPreRunE: Not specified, we need to test that it works in the absence of an explicit call |
| 19 | RunE: func(cmd *cobra.Command, args []string) error { |
| 20 | cli := dockerCli.Client() |
| 21 | ping, err := cli.Ping(cmd.Context(), client.PingOptions{}) |
| 22 | if err != nil { |
| 23 | return err |
| 24 | } |
| 25 | fmt.Println(ping.APIVersion) |
| 26 | return nil |
| 27 | }, |
| 28 | } |
| 29 | }, |
| 30 | metadata.Metadata{ |
| 31 | SchemaVersion: "0.1.0", |
| 32 | Vendor: "Docker Inc.", |
| 33 | Version: "testing", |
| 34 | }) |
| 35 | } |