Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions pkg/cmd/taskrun/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ func TestLog_taskrun_follow_mode_no_pod_name(t *testing.T) {
t.Error("Expecting an error but it's empty")
}

expected := "task output-task create has not started yet or pod for task not yet available"
expected := "pod for taskrun output-task-run not available yet"
test.AssertOutput(t, expected, err.Error())
}

Expand Down Expand Up @@ -1697,7 +1697,7 @@ func TestLog_taskrun_follow_mode_no_pod_name_v1beta1(t *testing.T) {
t.Error("Expecting an error but it's empty")
}

expected := "task output-task create has not started yet or pod for task not yet available"
expected := "pod for taskrun output-task-run not available yet"
test.AssertOutput(t, expected, err.Error())
}

Expand All @@ -1720,8 +1720,9 @@ func TestLog_taskrun_follow_mode_update_pod_name(t *testing.T) {
tb.TaskRunStatus(
tb.TaskRunStartTime(trStartTime),
tb.StatusCondition(apis.Condition{
Type: apis.ConditionSucceeded,
Status: corev1.ConditionTrue,
Type: apis.ConditionSucceeded,
Status: corev1.ConditionUnknown,
Message: "Running",
}),
tb.StepState(
cb.StepName(trStep1Name),
Expand Down Expand Up @@ -1832,8 +1833,9 @@ func TestLog_taskrun_follow_mode_update_pod_name_v1beta1(t *testing.T) {
Status: duckv1beta1.Status{
Conditions: duckv1beta1.Conditions{
{
Type: apis.ConditionSucceeded,
Status: corev1.ConditionTrue,
Type: apis.ConditionSucceeded,
Status: corev1.ConditionUnknown,
Message: v1beta1.TaskRunReasonRunning.String(),
},
},
},
Expand Down Expand Up @@ -1946,8 +1948,9 @@ func TestLog_taskrun_follow_mode_update_timeout(t *testing.T) {
tb.TaskRunStatus(
tb.TaskRunStartTime(trStartTime),
tb.StatusCondition(apis.Condition{
Type: apis.ConditionSucceeded,
Status: corev1.ConditionTrue,
Type: apis.ConditionSucceeded,
Status: corev1.ConditionUnknown,
Message: "Running",
}),
tb.StepState(
cb.StepName(trStep1Name),
Expand Down Expand Up @@ -2056,8 +2059,9 @@ func TestLog_taskrun_follow_mode_update_timeout_v1beta1(t *testing.T) {
Status: duckv1beta1.Status{
Conditions: duckv1beta1.Conditions{
{
Type: apis.ConditionSucceeded,
Status: corev1.ConditionTrue,
Type: apis.ConditionSucceeded,
Status: corev1.ConditionUnknown,
Message: v1beta1.TaskRunReasonRunning.String(),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/pipeline_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (r *Reader) readPipelineLog() (<-chan Log, <-chan error, error) {
return nil, nil, err
}

if r.follow {
if !pr.IsDone() && r.follow {
return r.readLivePipelineLogs(pr)
}
return r.readAvailablePipelineLogs(pr)
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/task_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *Reader) readTaskLog() (<-chan Log, <-chan error, error) {

r.formTaskName(tr)

if r.follow {
if !tr.IsDone() && r.follow {
return r.readLiveTaskLogs()
}
return r.readAvailableTaskLogs(tr)
Expand Down