@@ -304,24 +304,6 @@ func WaitForDefaultServiceAccountInNamespace(c clientset.Interface, namespace st
304
304
return waitForServiceAccountInNamespace (c , namespace , "default" , ServiceAccountProvisionTimeout )
305
305
}
306
306
307
- // WaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first.
308
- func WaitForPersistentVolumeDeleted (c clientset.Interface , pvName string , Poll , timeout time.Duration ) error {
309
- Logf ("Waiting up to %v for PersistentVolume %s to get deleted" , timeout , pvName )
310
- for start := time .Now (); time .Since (start ) < timeout ; time .Sleep (Poll ) {
311
- pv , err := c .CoreV1 ().PersistentVolumes ().Get (context .TODO (), pvName , metav1.GetOptions {})
312
- if err == nil {
313
- Logf ("PersistentVolume %s found and phase=%s (%v)" , pvName , pv .Status .Phase , time .Since (start ))
314
- continue
315
- }
316
- if apierrors .IsNotFound (err ) {
317
- Logf ("PersistentVolume %s was removed" , pvName )
318
- return nil
319
- }
320
- Logf ("Get persistent volume %s in failed, ignoring for %v: %v" , pvName , Poll , err )
321
- }
322
- return fmt .Errorf ("PersistentVolume %s still exists within %v" , pvName , timeout )
323
- }
324
-
325
307
// findAvailableNamespaceName random namespace name starting with baseName.
326
308
func findAvailableNamespaceName (baseName string , c clientset.Interface ) (string , error ) {
327
309
var name string
0 commit comments