MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / getPVCName

Function getPVCName

internal/controller/postgrescluster/volumes.go:899–906  ·  view source on GitHub ↗

getPVCName returns the name of a PVC that matches the selector, if any.

(volumes []*corev1.PersistentVolumeClaim, selector labels.Selector)

Source from the content-addressed store, hash-verified

897
898// getPVCName returns the name of a PVC that matches the selector, if any.
899func 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}

Calls 1

SetMethod · 0.65

Tested by 1

TestGetPVCNameMethodsFunction · 0.68