(ctx context.Context)
| 70 | --time 30 --client 1 --jobs 1` |
| 71 | |
| 72 | func (cmd *pgBenchRun) execute(ctx context.Context) error { |
| 73 | cluster, err := cmd.getCluster(ctx) |
| 74 | if err != nil { |
| 75 | return err |
| 76 | } |
| 77 | |
| 78 | job := cmd.buildJob(cluster) |
| 79 | |
| 80 | if cmd.dryRun { |
| 81 | return plugin.Print(job, plugin.OutputFormatYAML, os.Stdout) |
| 82 | } |
| 83 | |
| 84 | if err := plugin.Client.Create(ctx, job); err != nil { |
| 85 | return err |
| 86 | } |
| 87 | |
| 88 | fmt.Printf("job/%v created\n", job.Name) |
| 89 | return nil |
| 90 | } |
| 91 | |
| 92 | func (cmd *pgBenchRun) getCluster(ctx context.Context) (*apiv1.Cluster, error) { |
| 93 | var cluster apiv1.Cluster |
no test coverage detected