Skip to content

Commit 864eb0f

Browse files
committed
Fix admission sporadics
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
1 parent 401752c commit 864eb0f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

internal/admission/plugin/volumeresizepolicy/admission_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package volumeresizepolicy_test
55

66
import (
77
"context"
8+
"time"
89

910
corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1"
1011
storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1"
@@ -38,7 +39,9 @@ var _ = Describe("Admission", func() {
3839
},
3940
ResizePolicy: storagev1alpha1.ResizePolicyExpandOnly,
4041
}
41-
Expect(k8sClient.Create(ctx, volumeClassExpandOnly)).To(Succeed())
42+
Eventually(func() error {
43+
return k8sClient.Create(ctx, volumeClassExpandOnly)
44+
}).WithTimeout(30 * time.Second).WithPolling(pollingInterval).Should(Succeed())
4245
DeferCleanup(func(ctx context.Context) error {
4346
return client.IgnoreNotFound(k8sClient.Delete(ctx, volumeClassExpandOnly))
4447
})
@@ -54,7 +57,9 @@ var _ = Describe("Admission", func() {
5457
},
5558
ResizePolicy: storagev1alpha1.ResizePolicyStatic,
5659
}
57-
Expect(k8sClient.Create(ctx, volumeClassStatic)).To(Succeed())
60+
Eventually(func() error {
61+
return k8sClient.Create(ctx, volumeClassStatic)
62+
}).WithTimeout(30 * time.Second).WithPolling(pollingInterval).Should(Succeed())
5863
DeferCleanup(func(ctx context.Context) error {
5964
return client.IgnoreNotFound(k8sClient.Delete(ctx, volumeClassStatic))
6065
})

0 commit comments

Comments
 (0)