Skip to content

Commit

Permalink
Fix panic while running subctl gather
Browse files Browse the repository at this point in the history
Fixes issue: #1684
Signed-Off-by: Sridhar Gaddam <[email protected]>
  • Loading branch information
sridhargaddam authored and skitt committed Dec 16, 2021
1 parent 8d87d26 commit 1a893d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/subctl/cmd/gather/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ func outputPreviousPodLog(pod *corev1.Pod, podLogOptions corev1.PodLogOptions, i
defer logStream.Close()
}

podLogInfo.RestartCount = pod.Status.ContainerStatuses[0].RestartCount
if len(pod.Status.ContainerStatuses) > 0 {
podLogInfo.RestartCount = pod.Status.ContainerStatuses[0].RestartCount
}

return nil
}
Expand Down

0 comments on commit 1a893d5

Please sign in to comment.