Bi-directional bind between pv.Spec.ClaimRef and pvc.Spec.VolumeName
This commit is contained in:
@@ -653,9 +653,9 @@ func printNodeList(list *api.NodeList, w io.Writer) error {
|
||||
func printPersistentVolume(pv *api.PersistentVolume, w io.Writer) error {
|
||||
claimRefUID := ""
|
||||
if pv.Spec.ClaimRef != nil {
|
||||
claimRefUID += pv.Spec.ClaimRef.Namespace
|
||||
claimRefUID += "/"
|
||||
claimRefUID += pv.Spec.ClaimRef.Name
|
||||
claimRefUID += " / "
|
||||
claimRefUID += string(pv.Spec.ClaimRef.UID)
|
||||
}
|
||||
|
||||
modesStr := volume.GetAccessModesAsString(pv.Spec.AccessModes)
|
||||
@@ -677,11 +677,7 @@ func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer) erro
|
||||
}
|
||||
|
||||
func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer) error {
|
||||
volumeRefUID := ""
|
||||
if pvc.Status.VolumeRef != nil {
|
||||
volumeRefUID = string(pvc.Status.VolumeRef.UID)
|
||||
}
|
||||
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", pvc.Name, pvc.Labels, pvc.Status.Phase, volumeRefUID)
|
||||
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", pvc.Name, pvc.Labels, pvc.Status.Phase, pvc.Spec.VolumeName)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user