fix kubectl get cronjob lose age info

This commit is contained in:
zhengjiajin 2017-09-14 20:11:39 +08:00
parent e6209113e4
commit 6c84274113

View File

@ -817,10 +817,10 @@ func printCronJob(obj *batch.CronJob, options printers.PrintOptions) ([]metav1al
lastScheduleTime := "<none>"
if obj.Status.LastScheduleTime != nil {
lastScheduleTime = obj.Status.LastScheduleTime.Time.Format(time.RFC1123Z)
lastScheduleTime = translateTimestamp(*obj.Status.LastScheduleTime)
}
row.Cells = append(row.Cells, obj.Name, obj.Spec.Schedule, printBoolPtr(obj.Spec.Suspend), len(obj.Status.Active), lastScheduleTime)
row.Cells = append(row.Cells, obj.Name, obj.Spec.Schedule, printBoolPtr(obj.Spec.Suspend), len(obj.Status.Active), lastScheduleTime, translateTimestamp(obj.CreationTimestamp))
if options.Wide {
names, images := layoutContainerCells(obj.Spec.JobTemplate.Spec.Template.Spec.Containers)
row.Cells = append(row.Cells, names, images, metav1.FormatLabelSelector(obj.Spec.JobTemplate.Spec.Selector))