Skip to content

Commit 4f15c98

Browse files
authored
fix for no-resourcequotaTest (#3785)
1 parent 69a18ea commit 4f15c98

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/e2e/csi_static_provisioning_basic.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,12 +978,13 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() {
978978
curtimeinstring := strconv.FormatInt(curtime, 10)
979979
pvcName := "cns-pvc-" + curtimeinstring
980980

981-
restConfig, _, profileID := staticProvisioningPreSetUpUtil(ctx, f, client, storagePolicyName)
981+
storagePolicyName2 := GetAndExpectStringEnvVar(envStoragePolicyNameForSharedDatastores2)
982+
restConfig, _, profileID := staticProvisioningPreSetUpUtil(ctx, f, client, storagePolicyName2)
982983

983984
if isQuotaValidationSupported {
984985
totalQuotaUsedBefore, _, storagePolicyQuotaBefore, _, storagePolicyUsageBefore, _ =
985986
getStoragePolicyUsedAndReservedQuotaDetails(ctx, restConfig,
986-
storagePolicyName, namespace, pvcUsage, volExtensionName, false)
987+
storagePolicyName2, namespace, pvcUsage, volExtensionName, false)
987988
}
988989

989990
ginkgo.By("Create FCD with valid storage policy.")
@@ -993,7 +994,7 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() {
993994
deleteFCDRequired = false
994995

995996
ginkgo.By("Remove existing storage quota")
996-
removeStoragePolicyQuota(ctx, restConfig, storagePolicyName, namespace)
997+
removeStoragePolicyQuota(ctx, restConfig, storagePolicyName2, namespace)
997998

998999
ginkgo.By("Import above created FCD")
9991000
cnsRegisterVolume := getCNSRegisterVolumeSpec(ctx, namespace, fcdID, "", pvcName, v1.ReadWriteOnce)
@@ -1004,7 +1005,7 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() {
10041005
gomega.Expect(err).To(gomega.HaveOccurred())
10051006

10061007
ginkgo.By("Create resource quota")
1007-
setStoragePolicyQuota(ctx, restConfig, storagePolicyName, namespace, rqLimit)
1008+
setStoragePolicyQuota(ctx, restConfig, storagePolicyName2, namespace, rqLimit)
10081009
framework.Logf("Wait till the PVC creation succeeds after increasing resource quota")
10091010
framework.ExpectNoError(waitForCNSRegisterVolumeToGetCreated(ctx,
10101011
restConfig, namespace, cnsRegisterVolume, poll, pollTimeout))

tests/e2e/k8testutil/util.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6771,8 +6771,8 @@ func RemoveStoragePolicyQuota(ctx context.Context, restClientConfig *rest.Config
67716771
err = cnsOperatorClient.Get(ctx,
67726772
pkgtypes.NamespacedName{Name: scName + constants.StoragePolicyQuota, Namespace: namespace}, spq)
67736773
gomega.Expect(err).NotTo(gomega.HaveOccurred())
6774-
increaseLimit := spq.Spec.Limit
6775-
framework.Logf("Present quota Limit %s", increaseLimit)
6774+
specLimit := spq.Spec.Limit
6775+
framework.Logf("Present quota Limit %s", specLimit)
67766776
spq.Spec.Limit.Reset()
67776777

67786778
err = cnsOperatorClient.Update(ctx, spq)
@@ -6783,7 +6783,6 @@ func RemoveStoragePolicyQuota(ctx context.Context, restClientConfig *rest.Config
67836783
pkgtypes.NamespacedName{Name: scName + constants.StoragePolicyQuota, Namespace: namespace}, spq)
67846784
gomega.Expect(err).NotTo(gomega.HaveOccurred())
67856785
framework.Logf("Quota after removing: %s", spq.Spec.Limit)
6786-
67876786
}
67886787

67896788
// ToRef returns a pointer to t.

0 commit comments

Comments
 (0)