(name string)
| 134 | } |
| 135 | |
| 136 | func cleanupPVC(name string) { |
| 137 | By("Cleaning up shared PVC") |
| 138 | pvc := &corev1.PersistentVolumeClaim{} |
| 139 | pvcNN := namespacedName(name, testNamespace) |
| 140 | Eventually(func() error { |
| 141 | err := k8sClient.Get(ctx, pvcNN, pvc) |
| 142 | if k8sErrors.IsNotFound(err) { |
| 143 | return nil |
| 144 | } |
| 145 | // Need to clear finalizers to allow PVC to be cleaned up |
| 146 | pvc.Finalizers = nil |
| 147 | err = k8sClient.Update(ctx, pvc) |
| 148 | if err == nil { |
| 149 | return err |
| 150 | } |
| 151 | return fmt.Errorf("PVC not deleted yet") |
| 152 | }, timeout, interval).Should(Succeed(), "PVC should be deleted") |
| 153 | } |
| 154 | |
| 155 | func createObject(obj crclient.Object) { |
| 156 | Expect(k8sClient.Create(ctx, obj)).Should(Succeed()) |
no test coverage detected