Skip to content

Commit

Permalink
Storage quota changes in supervisor for policy driven allocation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aishwarya-Hebbar committed Sep 6, 2024
1 parent 44e9b3c commit eea879b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/e2e/policy_driven_vol_allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,17 @@ var _ = ginkgo.Describe("[vol-allocation] Policy driven volume space allocation

if supervisorCluster {
assignPolicyToWcpNamespace(client, ctx, namespace, policyNames, resourceQuotaLimit)
restClientConfig := getRestConfigClient()
for _, policyName := range policyNames {
setStoragePolicyQuota(ctx, restClientConfig, policyName, namespace, resourceQuotaLimit)
}
} else if guestCluster {
_, svNamespace := getSvcClientAndNamespace()
assignPolicyToWcpNamespace(client, ctx, svNamespace, policyNames, resourceQuotaLimit)
restClientConfig := getRestConfigClient()
for _, policyName := range policyNames {
setStoragePolicyQuota(ctx, restClientConfig, policyName, namespace, resourceQuotaLimit)
}
}

for i, policyName := range policyNames {
Expand All @@ -285,7 +293,7 @@ var _ = ginkgo.Describe("[vol-allocation] Policy driven volume space allocation
} else if supervisorCluster {
ginkgo.By("CNS_TEST: Running for WCP setup")
// create resource quota
createResourceQuota(client, namespace, rqLimit, policyName)
//createResourceQuota(client, namespace, rqLimit, policyName)
if wcpVsanDirectCluster {
storageclass, err = client.StorageV1().StorageClasses().Get(ctx, policyName, metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand All @@ -302,7 +310,7 @@ var _ = ginkgo.Describe("[vol-allocation] Policy driven volume space allocation
}
} else {
ginkgo.By("CNS_TEST: Running for GC setup")
createResourceQuota(client, namespace, rqLimit, policyName)
//createResourceQuota(client, namespace, rqLimit, policyName)
storageclass, err = client.StorageV1().StorageClasses().Get(ctx, policyName, metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
pvclaim, err = createPVC(ctx, client, namespace, nil, "", storageclass, "")
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7009,6 +7009,7 @@ func removeStoragePolicyQuota(ctx context.Context, restClientConfig *rest.Config
gomega.Expect(err).NotTo(gomega.HaveOccurred())

spq := &storagepolicyv1alpha2.StoragePolicyQuota{}
time.Sleep(7 * time.Minute)
err = cnsOperatorClient.Get(ctx,
pkgtypes.NamespacedName{Name: scName + storagePolicyQuota, Namespace: namespace}, spq)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down

0 comments on commit eea879b

Please sign in to comment.