(deps commandDeps)
| 2468 | } |
| 2469 | |
| 2470 | func newTaskRunClaimCommand(deps commandDeps) *cobra.Command { |
| 2471 | var idempotencyKey string |
| 2472 | |
| 2473 | cmd := &cobra.Command{ |
| 2474 | Use: "claim <run-id>", |
| 2475 | Short: "Claim a queued task run", |
| 2476 | Args: exactOneNonBlankArg(), |
| 2477 | RunE: func(cmd *cobra.Command, args []string) error { |
| 2478 | client, err := clientFromDeps(deps) |
| 2479 | if err != nil { |
| 2480 | return err |
| 2481 | } |
| 2482 | |
| 2483 | run, err := client.ClaimTaskRun(cmd.Context(), args[0], ClaimTaskRunRequest{ |
| 2484 | IdempotencyKey: strings.TrimSpace(idempotencyKey), |
| 2485 | }) |
| 2486 | if err != nil { |
| 2487 | return err |
| 2488 | } |
| 2489 | return writeCommandOutput(cmd, taskRunBundle(run)) |
| 2490 | }, |
| 2491 | } |
| 2492 | cmd.Flags().StringVar(&idempotencyKey, "idempotency-key", "", "Optional idempotency key") |
| 2493 | return cmd |
| 2494 | } |
| 2495 | |
| 2496 | func newTaskRunStartCommand(deps commandDeps) *cobra.Command { |
| 2497 | var idempotencyKey string |
no test coverage detected