Skip to content

Conversation

@nikhilbarge
Copy link
Contributor

@nikhilbarge nikhilbarge commented Dec 12, 2025

What this PR does / why we need it:
Fix the logic to fetch the pv and related pvc to include pvc namespace, as it is possible to have pvc with same name in different namespaces.
Also includes other code improvements

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:
Manual testing logs:

root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get pvc -n test-ns
NAME           STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                VOLUMEATTRIBUTESCLASS   AGE
pvc1           Bound    pvc-d86f5cb1-4b7f-42d0-95b6-52cc7374d152   5Gi        RWO            wcpglobal-storage-profile   <unset>                 24m
pvc2           Bound    pvc-6f3ac061-e7fb-45f1-a102-be199be15e30   5Gi        RWO            wcpglobal-storage-profile   <unset>                 24m
sample-claim   Bound    pvc-9f0143d1-9a93-4e69-a022-bbe44be74ece   5Gi        RWO            wcpglobal-storage-profile   <unset>                 20m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get pvc -n test-ns2
NAME           STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                VOLUMEATTRIBUTESCLASS   AGE
pvc1           Bound    pvc-b4dcaadb-df8a-457d-ac88-b737d4723271   5Gi        RWO            wcpglobal-storage-profile   <unset>                 24m
pvc2           Bound    pvc-e9d243d1-5f4c-4aa3-a5e9-ff6d7e9ba752   5Gi        RWO            wcpglobal-storage-profile   <unset>                 24m
sample-claim   Bound    pvc-3f0a8b01-6dfc-427a-9817-2aa61e166ac3   5Gi        RWO            wcpglobal-storage-profile   <unset>                 18m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get volumesnapshot -n test-ns
NAME            READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS                SNAPSHOTCONTENT                                    CREATIONTIME   AGE
pvc-snapshot1   true         pvc1                                5Gi           volumesnapshotclass-delete   snapcontent-b3eaef81-ac63-44c6-a887-7963cb1dbe72   11m            11m
pvc-snapshot2   true         pvc2                                5Gi           volumesnapshotclass-delete   snapcontent-5efe582a-0005-44c9-829e-6158383be82e   11m            11m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get volumesnapshot -n test-ns2
NAME            READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS                SNAPSHOTCONTENT                                    CREATIONTIME   AGE
pvc-snapshot1   true         pvc1                                5Gi           volumesnapshotclass-delete   snapcontent-5c9973b7-e660-4ba7-8ced-78beee168186   11m            11m
pvc-snapshot2   true         pvc2                                5Gi           volumesnapshotclass-delete   snapcontent-9293cdd0-cb7d-4bfd-af14-bdb10cfb5910   11m            11m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get vm -n test-ns
NAME        POWER-STATE   AGE
sample-vm   PoweredOn     21m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get vm -n test-ns2
NAME        POWER-STATE   AGE
sample-vm   PoweredOn     17m
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get vmsnapshot  -n test-ns     
NAME                   AGE
sample-vm-1-snapshot   8m28s
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get vmsnapshot  -n test-ns2
NAME                   AGE
sample-vm-1-snapshot   8m33s
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# 
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# k get StorageQuotaPeriodicSync -A -o yaml
apiVersion: v1
items:
- apiVersion: cns.vmware.com/v1alpha1
  kind: StorageQuotaPeriodicSync
  metadata:
    creationTimestamp: "2025-12-12T08:47:28Z"
    generation: 1
    name: storage-quota-periodic-sync
    namespace: vmware-system-csi
    resourceVersion: "2208896"
    uid: ed39d5b3-db68-4a47-b826-ad1b0bf8f3e2
  spec:
    syncIntervalInMinutes: 10
  status:
    expectedReservedValues:
    - namespace: svc-example-i4eh0
      reserved:
        8da079a3-e0bc-4fab-ac3b-0ef426a01878: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
        441542de-6cec-40df-8ebb-c206b3160ef0: "0"
        4d5f673c-536f-11e6-beb8-9e71128cae77: "0"
        e6c2e45f-7431-44b7-9e93-dedbf347a424: "0"
    - namespace: test-mobility-relocate-ns
      reserved:
        441542de-6cec-40df-8ebb-c206b3160ef0: "0"
    - namespace: test-ns2
      reserved:
        8da079a3-e0bc-4fab-ac3b-0ef426a01878: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
    - namespace: storage-policy-test
      reserved:
        8da079a3-e0bc-4fab-ac3b-0ef426a01878: "0"
    - namespace: svc-cci-ns-hm2et
      reserved:
        4d5f673c-536f-11e6-beb8-9e71128cae77: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
    - namespace: svc-tkg-jf5sp
      reserved:
        4d5f673c-536f-11e6-beb8-9e71128cae77: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
    - namespace: svc-velero-p6xh8
      reserved:
        4d5f673c-536f-11e6-beb8-9e71128cae77: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
    - namespace: test-ns
      reserved:
        8da079a3-e0bc-4fab-ac3b-0ef426a01878: "0"
        9f52a495-6548-4c0a-bef7-52df06236d6b: "0"
    lastSyncTimestamp: "2025-12-14T19:37:42Z"
kind: List
metadata:
  resourceVersion: ""
root@421fda5708535a2b6f3b79d5dd5d3967 [ ~ ]# 

reserve_fix_syncer.log
reserve_fix_vphere-csi-controller.log

Pipelines:
https://jenkins-vcf-csifvt.devops.broadcom.net/job/vks-instapp-e2e-pre-checkin/693/
https://jenkins-vcf-csifvt.devops.broadcom.net/job/wcp-instapp-e2e-pre-checkin/747/

Special notes for your reviewer:

Release note:

Fix invalid reserved values 

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 12, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @nikhilbarge. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nikhilbarge
Once this PR has been reviewed and has the lgtm label, please assign chethanv28 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 12, 2025
@nikhilbarge nikhilbarge force-pushed the fix_3627924_invalid_reserve_value branch 2 times, most recently from 0f28610 to f877630 Compare December 12, 2025 22:56
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2025
@nikhilbarge nikhilbarge force-pushed the fix_3627924_invalid_reserve_value branch from f877630 to 40e7334 Compare December 12, 2025 23:06
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 12, 2025
@deepakkinni
Copy link
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #746

@deepakkinni
Copy link
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #693

@deepakkinni
Copy link
Collaborator

SUCCESS --- Jenkins Build #693

@deepakkinni
Copy link
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #747

@deepakkinni
Copy link
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #694

@nikhilbarge nikhilbarge force-pushed the fix_3627924_invalid_reserve_value branch from 40e7334 to 2dfd1cb Compare December 15, 2025 05:56
@vdkotkar
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 15, 2025
@k8s-ci-robot
Copy link
Contributor

@nikhilbarge: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-vsphere-csi-driver-unit-test 2dfd1cb link true /test pull-vsphere-csi-driver-unit-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants