diff --git a/pkg/log/pipeline_reader.go b/pkg/log/pipeline_reader.go index a9af78dd1..41fbd743b 100644 --- a/pkg/log/pipeline_reader.go +++ b/pkg/log/pipeline_reader.go @@ -95,6 +95,13 @@ func (r *Reader) readAvailablePipelineLogs(pr *v1.PipelineRun) (<-chan Log, <-ch } taskRuns := taskrunpkg.Filter(ordered, r.tasks) + if len(taskRuns) == 0 && len(r.tasks) != 0 { + availTasks := []string{} + for _, o := range ordered { + availTasks = append(availTasks, o.Task) + } + return nil, nil, fmt.Errorf("passed filtered tasks: %v is not available, available tasks are: %v", r.tasks, availTasks) + } logC := make(chan Log) errC := make(chan error) @@ -123,7 +130,7 @@ func (r *Reader) readAvailablePipelineLogs(pr *v1.PipelineRun) (<-chan Log, <-ch // and keep checking the status until it changes to true|false // or the reach timeout func (r *Reader) waitUntilAvailable() error { - var first = true + first := true opts := metav1.ListOptions{ FieldSelector: fields.OneTermEqualSelector("metadata.name", r.run).String(), }