mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
add description of pvc condition for kubectl describe command
This commit is contained in:
parent
4f76fc2042
commit
49dcdbe2c5
@ -1264,6 +1264,20 @@ func describePersistentVolumeClaim(pvc *api.PersistentVolumeClaim, events *api.E
|
||||
if pvc.Spec.VolumeMode != nil {
|
||||
w.Write(LEVEL_0, "VolumeMode:\t%v\n", *pvc.Spec.VolumeMode)
|
||||
}
|
||||
if len(pvc.Status.Conditions) > 0 {
|
||||
w.Write(LEVEL_0, "Conditions:\n")
|
||||
w.Write(LEVEL_1, "Type\tStatus\tLastProbeTime\tLastTransitionTime\tReason\tMessage\n")
|
||||
w.Write(LEVEL_1, "----\t------\t-----------------\t------------------\t------\t-------\n")
|
||||
for _, c := range pvc.Status.Conditions {
|
||||
w.Write(LEVEL_1, "%v \t%v \t%s \t%s \t%v \t%v\n",
|
||||
c.Type,
|
||||
c.Status,
|
||||
c.LastProbeTime.Time.Format(time.RFC1123Z),
|
||||
c.LastTransitionTime.Time.Format(time.RFC1123Z),
|
||||
c.Reason,
|
||||
c.Message)
|
||||
}
|
||||
}
|
||||
if events != nil {
|
||||
DescribeEvents(events, w)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user