Skip to content
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

Add success event for static volume provisioning #2765

Merged

Conversation

skogta
Copy link
Contributor

@skogta skogta commented Jan 19, 2024

What this PR does / why we need it:
Add success event to a static PV after it has been created.

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:

  1. Created static PV and then deleted it from CNS. Full sync created the volume
root@k8s-control-120-1702312513:~# kubectl describe pv static-file-share-pv-name-2
Name:            static-file-share-pv-name-2
Labels:          static-pv-label-key=static-pv-label-value
Annotations:     pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    
Status:          Available
Claim:           
Reclaim Policy:  Retain
Access Modes:    RWX
VolumeMode:      Filesystem
Capacity:        1Gi
Node Affinity:   <none>
Message:         
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            csi.vsphere.vmware.com
    FSType:            
    VolumeHandle:      [file:e78ab145-027c-4fa1-8e85-7aecb5b34700](file:///e78ab145-027c-4fa1-8e85-7aecb5b34700)
    ReadOnly:          false
    VolumeAttributes:      type=vSphere CNS File Volume
Events:
  Type    Reason                                Age   From                Message
  ----    ------                                ----  ----                -------
  Normal  static volume provisioning succeeded  89s   VSphere CSI Syncer  Successfully created container volume
  1. Purposely failed static PV and then let full sync complete it.

File volume:

root@k8s-control-120-1702312513:~# kubectl describe pv static-file-share-pv-name-4
Name:            static-file-share-pv-name-4
Labels:          static-pv-label-key=static-pv-label-value
Annotations:     pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    
Status:          Available
Claim:           
Reclaim Policy:  Retain
Access Modes:    RWX
VolumeMode:      Filesystem
Capacity:        1Gi
Node Affinity:   <none>
Message:         
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            csi.vsphere.vmware.com
    FSType:            
    VolumeHandle:      [file:1c142992-9b34-4431-abd6-3924c543b6d9](file:///1c142992-9b34-4431-abd6-3924c543b6d9)
    ReadOnly:          false
    VolumeAttributes:      type=vSphere CNS File Volume
Events:
  Type     Reason                                Age    From                Message
  ----     ------                                ----   ----                -------
  Warning  static volume provisioning failed     3m25s  VSphere CSI Syncer  Failed to create volume on VC 10.193.34.118
  Normal   static volume provisioning succeeded  36s    VSphere CSI Syncer  Successfully created container volume

Block volume:

root@k8s-control-120-1702312513:~# kubectl describe pv vol1
Name:            vol1
Labels:          fcd-id=72fd3d8a-53d3-4af5-98a0-5d1028246937
Annotations:     pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    
Status:          Available
Claim:           
Reclaim Policy:  Retain
Access Modes:    RWO
VolumeMode:      Filesystem
Capacity:        1Gi
Node Affinity:   <none>
Message:         
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            csi.vsphere.vmware.com
    FSType:            
    VolumeHandle:      72fd3d8a-53d3-4af5-98a0-5d1028246937
    ReadOnly:          false
    VolumeAttributes:      type=vSphere CNS Block Volume
Events:
  Type     Reason                                Age    From                Message
  ----     ------                                ----   ----                -------
  Warning  static volume provisioning failed     2m39s  VSphere CSI Syncer  Failed to create volume on VC 10.193.34.118
  Normal   static volume provisioning succeeded  6s     VSphere CSI Syncer  Successfully created container volume
  1. Delete CNS volume for dynamic PV and made sure fullsync does not add event.
    File volume:
root@k8s-control-120-1702312513:~# kubectl describe pv pvc-b9fb3903-b550-4af2-a46c-913bf2e8092e
Name:            pvc-b9fb3903-b550-4af2-a46c-913bf2e8092e
Labels:          <none>
Annotations:     pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
                 volume.kubernetes.io/provisioner-deletion-secret-name: 
                 volume.kubernetes.io/provisioner-deletion-secret-namespace: 
Finalizers:      [kubernetes.io/pv-protection external-attacher/csi-vsphere-vmware-com]
StorageClass:    all-topo-sc
Status:          Bound
Claim:           default/topopvc-9kb9t
Reclaim Policy:  Delete
Access Modes:    RWX
VolumeMode:      Filesystem
Capacity:        1Gi
Node Affinity:   <none>
Message:         
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            csi.vsphere.vmware.com
    FSType:            nfs4
    VolumeHandle:      [file:998feaee-73b2-472d-9686-34bb7472f16c](file:///998feaee-73b2-472d-9686-34bb7472f16c)
    ReadOnly:          false
    VolumeAttributes:      storage.kubernetes.io/csiProvisionerIdentity=1705652098900-8111-csi.vsphere.vmware.com
                           type=vSphere CNS File Volume
Events:                <none>

Block volume:

root@k8s-control-120-1702312513:~# kubectl describe pv pvc-6200a117-929b-4894-833b-8919fd9ba4e7
Name:              pvc-6200a117-929b-4894-833b-8919fd9ba4e7
Labels:            <none>
Annotations:       pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
                   volume.kubernetes.io/provisioner-deletion-secret-name: 
                   volume.kubernetes.io/provisioner-deletion-secret-namespace: 
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      example-vanilla-block-sc
Status:            Bound
Claim:             default/example-vanilla-block-pvc-1
Reclaim Policy:    Delete
Access Modes:      RWO
VolumeMode:        Filesystem
Capacity:          5Gi
Node Affinity:     
  Required Terms:  
    Term 0:        topology.csi.vmware.com/region-cat-535 in [region-domain-c12-535]
                   topology.csi.vmware.com/zone-cat-535 in [zone-domain-c12-535]
Message:           
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            csi.vsphere.vmware.com
    FSType:            ext4
    VolumeHandle:      ae2a8ccd-63d4-4758-80a6-25c82b1d1e8d
    ReadOnly:          false
    VolumeAttributes:      storage.kubernetes.io/csiProvisionerIdentity=1705671281164-1993-csi.vsphere.vmware.com
                           type=vSphere CNS Block Volume
Events:                <none>

Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @skogta. 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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 19, 2024
@divyenpatel
Copy link
Member

/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 Jan 19, 2024
Copy link
Member

@divyenpatel divyenpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 19, 2024
@divyenpatel
Copy link
Member

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2024
@divyenpatel
Copy link
Member

@skogta can you fix linter issues on the PR?

pkg/syncer/fullsync.go Outdated Show resolved Hide resolved
@skogta skogta force-pushed the topic/skogta/staticvolerr branch 2 times, most recently from 84af94a to 8ffff9e Compare January 19, 2024 18:52
Copy link
Collaborator

@chethanv28 chethanv28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok-to-test
/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chethanv28, divyenpatel, skogta

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 [chethanv28,divyenpatel]

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 merged commit e7c51d3 into kubernetes-sigs:master Jan 19, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants