From 3c30d7c60ddd63662dbc25e59f71f3164fc38966 Mon Sep 17 00:00:00 2001 From: huntlyroad <43883246+huntlyroad@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:40:23 +0800 Subject: [PATCH] fix panic when trying to read pod logs when pod is already deleted --- pkg/log/task_reader.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/log/task_reader.go b/pkg/log/task_reader.go index 7ba470bb2a..8abc7e5b8e 100644 --- a/pkg/log/task_reader.go +++ b/pkg/log/task_reader.go @@ -290,6 +290,9 @@ func (r *Reader) getTaskRunPodNames(run *v1.TaskRun) (<-chan string, <-chan erro func filterSteps(pod *corev1.Pod, allSteps bool, stepsGiven []string) []*step { steps := []*step{} + if pod == nil { + return steps + } stepsInPod := getSteps(pod) if allSteps {