getPVCName returns the name of a PVC that matches the selector, if any.
(volumes []*corev1.PersistentVolumeClaim, selector labels.Selector)
| 897 | |
| 898 | // getPVCName returns the name of a PVC that matches the selector, if any. |
| 899 | func getPVCName(volumes []*corev1.PersistentVolumeClaim, selector labels.Selector) string { |
| 900 | for _, pvc := range volumes { |
| 901 | if selector.Matches(labels.Set(pvc.GetLabels())) { |
| 902 | return pvc.GetName() |
| 903 | } |
| 904 | } |
| 905 | return "" |
| 906 | } |