-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storage policy quota #3027
base: master
Are you sure you want to change the base?
storage policy quota #3027
Conversation
0440d5f
to
7dc7cac
Compare
Started GC block pipeline... |
ac647e0
to
1f9abaf
Compare
8f39aa0
to
6bbac3f
Compare
6bbac3f
to
6ad92d7
Compare
6ad92d7
to
4b79833
Compare
4b79833
to
ad62563
Compare
if vanillaCluster || supervisorCluster { | ||
snapshotHandle = *snapshotContent.Status.SnapshotHandle | ||
snapshotID = strings.Split(snapshotHandle, "+")[1] | ||
framework.Logf("********** snapshotHandle :%v", snapshotHandle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unnecessary log and commented lines across all files
@@ -140,6 +142,9 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() { | |||
} else { | |||
fullSyncWaitTime = defaultFullSyncWaitTime | |||
} | |||
vcAddress := e2eVSphere.Config.Global.VCenterHostname + ":" + sshdPort | |||
isStorageQuotaFSSEnabled = isFssEnabled(ctx, vcAddress, "STORAGE_QUOTA_M2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to remove this once the FSS is enabled
storageclass.Name, namespace, volExtensionName) | ||
framework.Logf("storagepolicyquota_pvc_after :%v", storagepolicyquota_pvc_after) | ||
|
||
storagepolicy_usage_pvc_after, _ = getStoragePolicyUsageForSpecificResourceType(ctx, restConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use camelCase to name your variables
storagepolicyUsage_reserved_Quota.String() == "0" | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments to this specific method
} | ||
|
||
// stopCSIPods function stops all the running csi pods | ||
func stopKubeSystemPods(ctx context.Context, client clientset.Interface, namespace string) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this method to appropriate name and add a comment accordingly
6. Delete pvcs and SC | ||
7. Verify no orphan volumes are left | ||
*/ | ||
ginkgo.It("create volume when storage-quota-weebhook goes down", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This testcase will run for vanilla as well, we can add a tag to just run for supervisor suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please correct the test steps accordingly
@@ -1624,6 +1750,31 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() { | |||
snapshotCreated, snapshotContentCreated, err = deleteVolumeSnapshot(ctx, snapc, namespace, | |||
volumeSnapshot, pandoraSyncWaitTime, volHandle, snapshotId, true) | |||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | |||
|
|||
if isStorageQuotaFSSEnabled && supervisorCluster { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if this can be seperated into 3 different functions:
- For volume and snapshot quota and usage before
- For volume and snapshot quota and usage after
- For cleanup of volumes and snapshots
|
||
storagepolicyquota_pvc_before, _ = getStoragePolicyQuotaForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, volExtensionName) | ||
framework.Logf("volume ********** storagepolicyquota_pvc_before :%v ", storagepolicyquota_pvc_before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some proper comment
|
||
storagepolicy_usage_pvc_before, _ = getStoragePolicyUsageForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, pvcUsage) | ||
framework.Logf("volume ********** storagepolicy_usage_pvc_before :%v", storagepolicy_usage_pvc_before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
|
||
storagepolicyquota_pvc_after, _ = getStoragePolicyQuotaForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, volExtensionName) | ||
framework.Logf("********** storagepolicyquota_pvc_after :%v", storagepolicyquota_pvc_after) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also
|
||
storagepolicy_usage_pvc_after, _ = getStoragePolicyUsageForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, pvcUsage) | ||
framework.Logf("********** pvc_Usage_Quota_After :%v", storagepolicy_usage_pvc_after) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also
@@ -2272,7 +2427,7 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() { | |||
}) | |||
|
|||
/* | |||
VMDK is deleted from datastore but CNS volume is still present | |||
VMDK is deleted from datastore but CNS volume is still presentx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modify this
|
||
storagepolicyquota_pvc_before, _ = getStoragePolicyQuotaForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, volExtensionName) | ||
framework.Logf("volume ********** storagepolicyquota_pvc_before :%v ", storagepolicyquota_pvc_before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add meaningful log
|
||
storagepolicy_usage_pvc_before, _ = getStoragePolicyUsageForSpecificResourceType(ctx, restConfig, | ||
storagePolicyName, namespace, pvcUsage) | ||
framework.Logf("volume ********** storagepolicy_usage_pvc_before :%v", storagepolicy_usage_pvc_before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
cnsOperatorClient, err := k8s.NewClientForGroup(ctx, restClientConfig, cnsoperatorv1alpha1.GroupName) | ||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | ||
|
||
//spq := &storagepolicyv1alpha2.StoragePolicyQuota{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this comment
if string(suffix1) == "Mi" { | ||
var bytes int64 = quotaBefore | ||
// Convert to Gi | ||
//kibibytes := float64(bytes) / 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all commented code if not required
@@ -284,6 +290,45 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() { | |||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | |||
}() | |||
|
|||
if isStorageQuotaFSSEnabled { | |||
totalquota_used_before, _ = getTotalQuotaConsumedByStoragePolicy(ctx, restConfig, storageclass.Name, namespace) | |||
framework.Logf("************ totalUsedQuota_Before :%v", totalquota_used_before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add meanningful comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kavyashree-r, rajguptavm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Testing done:
A PR must be marked "[WIP]", if no test result is provided. A WIP PR won't be reviewed, nor merged.
The requester can determine a sufficient test, e.g. build for a cosmetic change, E2E test in a predeployed setup, etc.
For new features, new tests should be done, in addition to regression tests.
If jtest is used to trigger precheckin tests, paste the result after jtest completes and remove [WIP] in the PR subject.
The review cycle will start, only after "[WIP]" is removed from the PR subject.
Special notes for your reviewer:
Release note: