Skip to content

Commit e37b378

Browse files
authored
Merge pull request #5 from flyhope/1-show-pod-list-panic
fix: show pod list panic
2 parents 60e247f + 9e5a880 commit e37b378

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

view/pod.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,18 @@ func (c *podModel) updateData(force bool) {
3838
// name = strings.TrimLeft(name, "-_.")
3939
//}
4040

41+
// 格式化时间输出
42+
timeStr := "-"
43+
startTime := pod.Status.StartTime
44+
if startTime == nil {
45+
timeStr = pod.Status.StartTime.Format(time.DateTime)
46+
}
47+
4148
rows = append(rows, table.Row{
4249
name,
4350
pod.Status.PodIP,
4451
PodPhaseView(pod.Status.Phase),
45-
pod.Status.StartTime.Format(time.DateTime),
52+
timeStr,
4653
})
4754
}
4855
}

0 commit comments

Comments
 (0)