diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 7239652cb34..4148e8cbe1c 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -636,7 +636,7 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) { printLabelsMultiline(w, "Labels", pod.Labels) printAnnotationsMultiline(w, "Annotations", pod.Annotations) if pod.DeletionTimestamp != nil { - w.Write(LEVEL_0, "Status:\tTerminating (expires %s)\n", pod.DeletionTimestamp.Time.Format(time.RFC1123Z)) + w.Write(LEVEL_0, "Status:\tTerminating (lasts %s)\n", translateTimestamp(*pod.DeletionTimestamp)) w.Write(LEVEL_0, "Termination Grace Period:\t%ds\n", *pod.DeletionGracePeriodSeconds) } else { w.Write(LEVEL_0, "Status:\t%s\n", string(pod.Status.Phase)) @@ -1137,8 +1137,13 @@ func describePersistentVolume(pv *api.PersistentVolume, events *api.EventList) ( w.Write(LEVEL_0, "Name:\t%s\n", pv.Name) printLabelsMultiline(w, "Labels", pv.Labels) printAnnotationsMultiline(w, "Annotations", pv.Annotations) + w.Write(LEVEL_0, "Finalizers:\t%v\n", pv.ObjectMeta.Finalizers) w.Write(LEVEL_0, "StorageClass:\t%s\n", helper.GetPersistentVolumeClass(pv)) - w.Write(LEVEL_0, "Status:\t%s\n", pv.Status.Phase) + if pv.ObjectMeta.DeletionTimestamp != nil { + w.Write(LEVEL_0, "Status:\tTerminating (lasts %s)\n", translateTimestamp(*pv.ObjectMeta.DeletionTimestamp)) + } else { + w.Write(LEVEL_0, "Status:\t%v\n", pv.Status.Phase) + } if pv.Spec.ClaimRef != nil { w.Write(LEVEL_0, "Claim:\t%s\n", pv.Spec.ClaimRef.Namespace+"/"+pv.Spec.ClaimRef.Name) } else { @@ -1235,7 +1240,7 @@ func describePersistentVolumeClaim(pvc *api.PersistentVolumeClaim, events *api.E w.Write(LEVEL_0, "Namespace:\t%s\n", pvc.Namespace) w.Write(LEVEL_0, "StorageClass:\t%s\n", helper.GetPersistentVolumeClaimClass(pvc)) if pvc.ObjectMeta.DeletionTimestamp != nil { - w.Write(LEVEL_0, "Status:\tTerminating (since %s)\n", pvc.ObjectMeta.DeletionTimestamp.Time.Format(time.RFC1123Z)) + w.Write(LEVEL_0, "Status:\tTerminating (lasts %s)\n", translateTimestamp(*pvc.ObjectMeta.DeletionTimestamp)) } else { w.Write(LEVEL_0, "Status:\t%v\n", pvc.Status.Phase) } diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go index 26f7b6d74b0..46eb9e59819 100644 --- a/pkg/printers/internalversion/printers.go +++ b/pkg/printers/internalversion/printers.go @@ -1201,8 +1201,13 @@ func printPersistentVolume(obj *api.PersistentVolume, options printers.PrintOpti aQty := obj.Spec.Capacity[api.ResourceStorage] aSize := aQty.String() + phase := obj.Status.Phase + if obj.ObjectMeta.DeletionTimestamp != nil { + phase = "Terminating" + } + row.Cells = append(row.Cells, obj.Name, aSize, modesStr, reclaimPolicyStr, - obj.Status.Phase, claimRefUID, helper.GetPersistentVolumeClass(obj), + phase, claimRefUID, helper.GetPersistentVolumeClass(obj), obj.Status.Reason, translateTimestamp(obj.CreationTimestamp)) return []metav1alpha1.TableRow{row}, nil