Bi-directional bind between pv.Spec.ClaimRef and pvc.Spec.VolumeName

This commit is contained in:
markturansky
2015-05-12 20:44:29 -04:00
parent 9454d58547
commit 0191574f7e
18 changed files with 247 additions and 295 deletions

View File

@@ -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
}