Skip to content

Commit

Permalink
Fix func test failure and address some review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Henriksen <[email protected]>
  • Loading branch information
mhenriks committed Jan 13, 2024
1 parent f100689 commit 50fc0c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/apiserver/webhooks/datavolume-validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ var _ = Describe("Validating Webhook", func() {
Expect(resp.Allowed).To(BeTrue())
})

It("should accept DataVolume with unbound PVC and adoption featurgate set", func() {
It("should reject DataVolume with unbound PVC and adoption featurgate set", func() {
dataVolume := newHTTPDataVolume("testDV", "http://www.example.com")
pvc := &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Expand Down
4 changes: 4 additions & 0 deletions tests/framework/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func (f *Framework) CreateBoundPVCFromDefinition(def *k8sv1.PersistentVolumeClai
gomega.Expect(err).ToNot(gomega.HaveOccurred())

f.ForceBindIfWaitForFirstConsumer(pvc)
err = utils.WaitForPersistentVolumeClaimPhase(f.K8sClient, pvc.Namespace, k8sv1.ClaimBound, pvc.Name)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
pvc, err = utils.FindPVC(f.K8sClient, pvc.Namespace, pvc.Name)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
return pvc
}

Expand Down
8 changes: 4 additions & 4 deletions tests/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,10 @@ var _ = Describe("Block PV upload Test", Serial, func() {
f := framework.NewFramework(namespacePrefix)

BeforeEach(func() {
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}

if pvc != nil {
Eventually(func() bool {
// Make sure the pvc doesn't still exist. The after each should have called delete.
Expand Down Expand Up @@ -995,10 +999,6 @@ var _ = Describe("Block PV upload Test", Serial, func() {
})

DescribeTable("should", func(validToken bool, expectedStatus int) {
if !f.IsBlockVolumeStorageClassAvailable() {
Skip("Storage Class for block volume is not available")
}

By("Verify PVC annotation says ready")
found, err := utils.WaitPVCPodStatusReady(f.K8sClient, pvc)
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 50fc0c6

Please sign in to comment.