MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / cleanupPVC

Function cleanupPVC

controllers/workspace/util_test.go:136–153  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

134}
135
136func 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
155func createObject(obj crclient.Object) {
156 Expect(k8sClient.Create(ctx, obj)).Should(Succeed())

Callers 1

Calls 2

namespacedNameFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected