mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 08:09:58 +00:00
fix kubectl get cronjob lose age info
This commit is contained in:
parent
e6209113e4
commit
6c84274113
@ -817,10 +817,10 @@ func printCronJob(obj *batch.CronJob, options printers.PrintOptions) ([]metav1al
|
|||||||
|
|
||||||
lastScheduleTime := "<none>"
|
lastScheduleTime := "<none>"
|
||||||
if obj.Status.LastScheduleTime != nil {
|
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 {
|
if options.Wide {
|
||||||
names, images := layoutContainerCells(obj.Spec.JobTemplate.Spec.Template.Spec.Containers)
|
names, images := layoutContainerCells(obj.Spec.JobTemplate.Spec.Template.Spec.Containers)
|
||||||
row.Cells = append(row.Cells, names, images, metav1.FormatLabelSelector(obj.Spec.JobTemplate.Spec.Selector))
|
row.Cells = append(row.Cells, names, images, metav1.FormatLabelSelector(obj.Spec.JobTemplate.Spec.Selector))
|
||||||
|
Loading…
Reference in New Issue
Block a user