Skip to content

Commit

Permalink
fix(dashboard): fix viewing pipeline with 0 steps (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimVosch authored Oct 7, 2024
1 parent 07de8a1 commit 571b06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/dashboard/routes/pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ func (h *PipelinePageHandler) resolveWorkers(next http.Handler) http.Handler {
// This method and it's references can simply be deleted once the workers have been rewritten to userworkers.

func (h *PipelinePageHandler) getWorkersForSteps(r *http.Request, steps []string) ([]api.UserWorker, error) {
if len(steps) == 0 {
return []api.UserWorker{}, nil
}
// Try and fetch all workers from user-workers service.
// For any worker not found create a "placeholder" worker
res, _, err := h.workersClient.WorkersApi.ListWorkers(r.Context()).Id(steps).Execute()
Expand All @@ -503,6 +506,8 @@ func (h *PipelinePageHandler) getWorkersForSteps(r *http.Request, steps []string
workers := res.GetData()
workers = append(workers, createPlaceholderWorkers(missingWorkers)...)

fmt.Printf("workers: %v\n", workers)
fmt.Printf("steps: %v\n", steps)
if len(workers) != len(steps) {
return nil, fmt.Errorf("some pipeline workers not found")
}
Expand Down

0 comments on commit 571b06d

Please sign in to comment.