mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #7676 from markturansky/fix_nil_ptr
Fixed nil pointer issue in describe when volume is unbound
This commit is contained in:
commit
9581aa85e9
@ -303,8 +303,11 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string) (string, er
|
||||
fmt.Fprintf(out, "Name:\t%s\n", pv.Name)
|
||||
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(pv.Labels))
|
||||
fmt.Fprintf(out, "Status:\t%d\n", pv.Status.Phase)
|
||||
fmt.Fprintf(out, "Claim:\t%d\n", pv.Spec.ClaimRef.UID)
|
||||
|
||||
if pv.Spec.ClaimRef != nil {
|
||||
fmt.Fprintf(out, "Claim:\t%d\n", pv.Spec.ClaimRef.Namespace+"/"+pv.Spec.ClaimRef.Name)
|
||||
} else {
|
||||
fmt.Fprintf(out, "Claim:\t%d\n", "")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user