kubernetes-sigs / vsphere-csi-driver

vSphere storage Container Storage Interface (CSI) plugin
https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/index.html
Apache License 2.0
288 stars 173 forks source link

Changing storagequota extension service name to keep it consistent in all StoragePolicyQuota/StoragePolicyUsage CRs (including CRs upgraded from 8.0u3 to 9.0) #2941

Closed vdkotkar closed 1 week ago

vdkotkar commented 1 week ago

What this PR does / why we need it: We already used "volume.cns.vsphere.vmware.com" and "snapshot.cns.vsphere.vmware.com" as extension service name in vSphere 8.0u3 StoragePolicyQuota and StoragePolicyUsage CRs (even though we were not using extension service). So, to avoid patching older CRs in case of upgrade to vSphere 9.0 version, keeping same extension service name in CR status. Internally storage quota webhook will use appropriate extension service name to send requests for getting resource capacity.

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: Verified that PVC creation is successful with these changes:

# k get pvc -n quota-ns
NAME                    STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                VOLUMEATTRIBUTESCLASS   AGE
example-raw-block-pvc   Bound    pvc-a205527a-c03f-4ac6-a00e-9efb10ba84d2   10Mi       RWO            wcpglobal-storage-profile   <unset>                 9m7s

storagepolicyquota details:

# k describe storagepolicyquota -n quota-ns
Name:         wcpglobal-storage-profile-storagepolicyquota
Namespace:    quota-ns
Labels:       <none>
Annotations:  <none>
API Version:  cns.vmware.com/v1alpha1
Kind:         StoragePolicyQuota
Metadata:
  Creation Timestamp:  2024-07-02T11:08:12Z
  Generation:          1
  Resource Version:    38184008
  UID:                 6939d63b-f860-4e34-882f-bd2194122598
Spec:
  Limit:              9223372036854775807
  Storage Policy Id:  d241183b-3e4d-445a-be8a-ca15c753f68c
Status:
  Extensions:
    Extension Name:  volume.cns.vsphere.vmware.com
    Extension Quota Usage:
      Sc Quota Usage:
        Reserved:          0
        Used:              10Mi
      Storage Class Name:  wcpglobal-storage-profile
    Extension Name:        snapshot.cns.vsphere.vmware.com
    Extension Quota Usage:
      Sc Quota Usage:
        Reserved:          0
        Used:              0
      Storage Class Name:  wcpglobal-storage-profile
  Total:
    Sc Quota Usage:
      Reserved:          0
      Used:              10Mi
    Storage Class Name:  wcpglobal-storage-profile
Events:                  <none>

storagepolicyusage details:

# k describe storagepolicyusage -n quota-ns
Name:         wcpglobal-storage-profile-pvc-usage
Namespace:    quota-ns
Labels:       <none>
Annotations:  <none>
API Version:  cns.vmware.com/v1alpha1
Kind:         StoragePolicyUsage
Metadata:
  Creation Timestamp:  2024-07-02T11:08:12Z
  Generation:          3
  Resource Version:    38183998
  UID:                 55ebb079-696e-4345-86af-1df3e867154e
Spec:
  Resource API Group:       
  Resource Extension Name:  volume.cns.vsphere.vmware.com
  Resource Kind:            PersistentVolumeClaim
  Storage Class Name:       wcpglobal-storage-profile
  Storage Policy Id:        d241183b-3e4d-445a-be8a-ca15c753f68c
Status:
  Quota Usage:
    Reserved:  0
    Used:      10Mi
Events:        <none>

Special notes for your reviewer:

Release note:

Changing storagequota extension service name to keep it consistent in all StoragePolicyQuota/StoragePolicyUsage CRs (including CRs upgraded from 8.0u3 to 9.0)
k8s-ci-robot commented 1 week ago

Hi @vdkotkar. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
xing-yang commented 1 week ago

/ok-to-test

deepakkinni commented 1 week ago

Let's add corresponding MRs in all different repos in the description. This will be easy to for cross-referencing:

  1. storage-policy-quota-extensions: https://gitlab.eng.vmware.com/core-build/storage-policy-quota-extensions/-/merge_requests/6
  2. storage-policy-quota: https://gitlab.eng.vmware.com/core-build/storage-policy-quota/-/merge_requests/53
  3. csi-driver: https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2941
deepakkinni commented 1 week ago

Change the description, apart from that, this looks fine.

/approve

xing-yang commented 1 week ago

/lgtm /approve

k8s-ci-robot commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakkinni, vdkotkar, xing-yang

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/OWNERS)~~ [deepakkinni,xing-yang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment