GetTaskRunV1 gets a task run.
(ctx context.Context, find *FindTaskRunMessage)
| 191 | |
| 192 | // GetTaskRunV1 gets a task run. |
| 193 | func (s *Store) GetTaskRunV1(ctx context.Context, find *FindTaskRunMessage) (*TaskRunMessage, error) { |
| 194 | taskRuns, err := s.ListTaskRuns(ctx, find) |
| 195 | if err != nil { |
| 196 | return nil, err |
| 197 | } |
| 198 | if len(taskRuns) == 0 { |
| 199 | return nil, nil |
| 200 | } |
| 201 | if len(taskRuns) > 1 { |
| 202 | return nil, errors.Errorf("expected to get one task run, but got %d", len(taskRuns)) |
| 203 | } |
| 204 | return taskRuns[0], nil |
| 205 | } |
| 206 | |
| 207 | // UpdateTaskRunStatus updates task run status. |
| 208 | func (s *Store) UpdateTaskRunStatus(ctx context.Context, patch *TaskRunStatusPatch) (*TaskRunMessage, error) { |
no test coverage detected