provider/tekton: stream non-terminal pod logs with follow=true
The Logs path for a still-running PipelineRun called StreamPodLogs
without follow=true, so the apiserver returned a snapshot of the
container log and EOF'd at the current tail. The provider then
emitted StepStatusEnd and moved on, which made still-running steps
look complete and dropped any subsequent log bytes unless the client
reconnected. The same one-shot pass also took a single snapshot of
TaskRuns, so any TaskRun spawned later in the PipelineRun (sequential
runAfter, finally, retries) was silently ignored.
StreamPodLogs now takes a LogOptions{Follow bool}. The non-terminal
path uses Follow=true so the read only EOFs once the container
actually terminates; the terminal path keeps the snapshot read since
the log is already complete. The Logs goroutine is replaced with a
poll loop that re-lists TaskRuns and re-checks the PipelineRun's
terminal state each iteration, only closing the channel once the
PipelineRun is terminal AND no new TaskRuns appeared in the last
pass. The fake k8s client mirrors the apiserver's follow semantics
by holding the reader open until ctx is cancelled.
authored by