Skip to content

Commit 9e5a880

Browse files
committed
show pod list panic
fix #1
1 parent 60e247f commit 9e5a880

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)