mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Show events in 'kubectl describe pv'
This commit is contained in:
@@ -724,6 +724,11 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
|
||||
|
||||
storage := pv.Spec.Capacity[api.ResourceStorage]
|
||||
|
||||
var events *api.EventList
|
||||
if describerSettings.ShowEvents {
|
||||
events, _ = d.Events(namespace).Search(pv)
|
||||
}
|
||||
|
||||
return tabbedString(func(out io.Writer) error {
|
||||
fmt.Fprintf(out, "Name:\t%s\n", pv.Name)
|
||||
printLabelsMultiline(out, "Labels", pv.Labels)
|
||||
@@ -756,6 +761,10 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
|
||||
printRBDVolumeSource(pv.Spec.RBD, out)
|
||||
}
|
||||
|
||||
if events != nil {
|
||||
DescribeEvents(events, out)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user