mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #89646 from zhouya0/fix_kubectl_describe_CSINode_nil_pointer
Fix kubectl describe CSINode nil pointer error
This commit is contained in:
commit
933c303592
@ -4031,12 +4031,16 @@ func describeCSINode(csi *storagev1.CSINode, events *corev1.EventList) (output s
|
||||
w.Write(LEVEL_1, "Drivers:\n")
|
||||
for _, driver := range csi.Spec.Drivers {
|
||||
w.Write(LEVEL_2, "%s:\n", driver.Name)
|
||||
w.Write(LEVEL_3, "Node ID:\t%s\n", driver.NodeID)
|
||||
if driver.Allocatable.Count != nil {
|
||||
w.Write(LEVEL_3, "Allocatables:\n")
|
||||
w.Write(LEVEL_4, "Count:\t%d\n", *driver.Allocatable.Count)
|
||||
w.Write(LEVEL_3, "Node ID:\t%s\n", driver.NodeID)
|
||||
}
|
||||
if driver.TopologyKeys != nil {
|
||||
w.Write(LEVEL_3, "Topology Keys:\t%s\n", driver.TopologyKeys)
|
||||
}
|
||||
}
|
||||
}
|
||||
if events != nil {
|
||||
DescribeEvents(events, w)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user