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
293 stars 177 forks source link

remove usage of deprecated API WaitForResult #2825

Closed divyenpatel closed 5 months ago

divyenpatel commented 5 months ago

What this PR does / why we need it:

Linter check is failing after https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2821

In this PR replacing usage of WaitForUpdates API with new API WaitForUpdatesEx.

property.WaitForUpdates is deprecated: Please consider using WaitForUpdatesEx instead, as it does not create a new property collector, instead it destroys the property filter after the expected update is received. (SA1019)

Since this change is present in govmomi v0.36.1 v0.36.0 v0.35.0, it is essential to move to new API. Also we want to add support for sha256 thumbprint introduced in https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2821

@skogta I will close https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2824 if pre-checkin job passes with this change.

Testing done:

  1. Executed make check
  2. Verified creating statefulset with 1 replica with this change. and confirmed no issue observed in the logs in CSI controller and CSI syncer specifically for list-view API.
root@k8s-control-372-1710292600:~# kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
web-0   1/1     Running   0          4m25s
root@k8s-control-372-1710292600:~# kubectl get pvc
NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                        VOLUMEATTRIBUTESCLASS   AGE
www-web-0   Bound    pvc-9594238f-700a-4669-a757-23caca16d1b7   1Gi        RWO            example-vanilla-rwo-filesystem-sc   <unset>                 4m28s

Running pre-checkin job is in progress

Special notes for your reviewer:

Release note:

remove usage of deprecated API WaitForResult
svcbot-qecnsdp commented 5 months ago

Started Vanilla block pre-checkin pipeline... Build Number: 2696

svcbot-qecnsdp commented 5 months ago
Build ID: 2696
Block vanilla build status: FAILURE 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 816 Specs in 370.569 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 815 Skipped
PASS

Ginkgo ran 1 suite in 7m4.910475993s
Test Suite Passed
--
Ran 13 of 816 Specs in 3828.474 seconds
FAIL! -- 9 Passed | 4 Failed | 0 Pending | 803 Skipped
--- FAIL: TestE2E (3828.54s)
FAIL

Ginkgo ran 1 suite in 1h4m3.629503724s

Test Suite Failed
divyenpatel commented 5 months ago

FAIL! -- 9 Passed | 4 Failed | 0 Pending | 803 Skipped

3 test cases failed with

06:53:14    [FAILED] Unexpected error:
06:53:14        <*errors.errorString | 0xc000f4cd80>: 
06:53:14        unknown key thumbprint in the input string
06:53:14        {
06:53:14            s: "unknown key thumbprint in the input string",
06:53:14        }
06:53:14    occurred
06:53:14    In [BeforeEach] at: /home/worker/workspace/csi-block-vanilla-precheckin/2696/vsphere-csi-driver/tests/e2e/util.go:4337 @ 03/15/24 06:53:12.994

Filed bug to get e2e tests corrected to support thumbprint parameter in the config secret.

1 test failed due to

06:52:11    [FAILED] Unexpected error:
06:52:11        <*errors.errorString | 0xc000f4d370>: 
06:52:11        pod "pvc-tester-xgf2c" is not Running: error while waiting for pod e2e-full-sync-test-1893/pvc-tester-xgf2c to be running: etcdserver: leader changed
06:52:11        {
06:52:11            s: "pod \"pvc-tester-xgf2c\" is not Running: error while waiting for pod e2e-full-sync-test-1893/pvc-tester-xgf2c to be running: etcdserver: leader changed",
06:52:11        }
svcbot-qecnsdp commented 5 months ago

Started Vanilla block pre-checkin pipeline... Build Number: 2697

svcbot-qecnsdp commented 5 months ago
Build ID: 2697
Block vanilla build status: FAILURE 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 816 Specs in 374.977 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 815 Skipped
PASS

Ginkgo ran 1 suite in 7m8.143426364s
Test Suite Passed
--
Ran 13 of 816 Specs in 7787.487 seconds
FAIL! -- 8 Passed | 5 Failed | 0 Pending | 803 Skipped
--- FAIL: TestE2E (7787.55s)
FAIL

Ginkgo ran 1 suite in 2h10m2.633298151s

Test Suite Failed
k8s-ci-robot commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

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

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)~~ [chethanv28,divyenpatel] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment