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
289 stars 173 forks source link

Use k8s mount util for bind volume #2861

Closed nikhilbarge closed 2 months ago

nikhilbarge commented 3 months ago

What this PR does / why we need it: Bug fix: PVC mount become ReadOnly on same node when a volume ReadOnly is mounted Used k8s mount utils instead of gofsutil and used Mount with bind mount parameter.

Testing done: Running e2e tests Manually tested the scenario: As shown in attached log file, I have Created two pods with the same volume one with Readwrite then other one with read only mount permissions. Verified that i am able to write to volume from pod with RW access even after new pod is created with Readonly

test_read_only_mount.log

tested file pvc RWX and verified if volume mount is successful test_pvc_RWX.log

tested File pvc RWO and verified if volume mount is successful test_pvc_file_rwo.log

Here we are using same volume for two Pods. but actually we do not support using same volume for two Pods unless it is RWM volume. In terms of k8s RWO is for node and not pod, but we treated it as RWO for pod.

Special notes for your reviewer:

Release note:

Use k8s mount util for bind volume and fix read only mount issue.  
k8s-ci-robot commented 3 months ago

Hi @nikhilbarge. 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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
svcbot-qecnsdp commented 3 months ago

Started vanilla Block pipeline... Build Number: 2568

svcbot-qecnsdp commented 3 months ago
Block vanilla build status: FAILURE 
Stage before exit: make-images 
svcbot-qecnsdp commented 3 months ago

Started vanilla Block pipeline... Build Number: 2569

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

Ran 1 of 848 Specs in 395.789 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 847 Skipped
PASS

Ginkgo ran 1 suite in 7m36.909263404s
Test Suite Passed
--
Ran 14 of 848 Specs in 9495.697 seconds
FAIL! -- 7 Passed | 7 Failed | 0 Pending | 834 Skipped
--- FAIL: TestE2E (9495.78s)
FAIL

Ginkgo ran 1 suite in 2h38m32.129907534s

Test Suite Failed
svcbot-qecnsdp commented 3 months ago

Started vanilla Block pipeline... Build Number: 2570

svcbot-qecnsdp commented 3 months ago
Block vanilla build status: FAILURE 
Stage before exit: testbed-deployment 
svcbot-qecnsdp commented 3 months ago

Started vanilla Block pipeline... Build Number: 2571

svcbot-qecnsdp commented 3 months ago
Block vanilla build status: SUCCESS 
Stage before exit: finally 
Jenkins E2E Test Results: 
------------------------------

Ran 0 of 848 Specs in 0.019 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 848 Skipped
PASS

Ginkgo ran 1 suite in 1m7.475228375s
Test Suite Passed
svcbot-qecnsdp commented 3 months ago

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

svcbot-qecnsdp commented 3 months ago
Build ID: 2745
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 0 of 848 Specs in 0.018 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 848 Skipped
PASS

Ginkgo ran 1 suite in 1m10.378598655s
Test Suite Passed
svcbot-qecnsdp commented 3 months ago

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

svcbot-qecnsdp commented 3 months ago

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

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

Ran 1 of 848 Specs in 368.949 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 847 Skipped
PASS

Ginkgo ran 1 suite in 7m18.407774359s
Test Suite Passed
--
Ran 13 of 848 Specs in 1018.237 seconds
FAIL! -- 0 Passed | 13 Failed | 0 Pending | 835 Skipped
--- FAIL: TestE2E (1018.35s)
FAIL

Ginkgo ran 1 suite in 17m17.057650482s

Test Suite Failed
svcbot-qecnsdp commented 2 months ago

Started vanilla Block pipeline... Build Number: 2572

svcbot-qecnsdp commented 2 months ago

Started vanilla Block pipeline... Build Number: 2573

svcbot-qecnsdp commented 2 months ago
Block vanilla build status: FAILURE 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
Ran 1 of 848 Specs in 398.351 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 847 Skipped
--- FAIL: TestE2E (398.42s)
FAIL

Ginkgo ran 1 suite in 8m3.94279412s

Test Suite Failed
svcbot-qecnsdp commented 2 months ago
Block vanilla build status: FAILURE 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 848 Specs in 403.275 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 847 Skipped
PASS

Ginkgo ran 1 suite in 7m45.718938423s
Test Suite Passed
--
------------------------------

Ran 14 of 848 Specs in 7443.332 seconds
SUCCESS! -- 14 Passed | 0 Failed | 0 Pending | 834 Skipped
PASS

Ginkgo ran 1 suite in 2h4m20.427573634s
Test Suite Passed
--

Ran 52 of 848 Specs in 654.439 seconds
FAIL! -- 43 Passed | 9 Failed | 0 Pending | 796 Skipped

Ginkgo ran 1 suite in 11m11.261896661s

Test Suite Failed
svcbot-qecnsdp commented 2 months ago

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

svcbot-qecnsdp commented 2 months ago
Build ID: 2748
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 0 of 848 Specs in 0.021 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 848 Skipped
PASS

Ginkgo ran 1 suite in 1m14.254358329s
Test Suite Passed
svcbot-qecnsdp commented 2 months ago

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

svcbot-qecnsdp commented 2 months ago
Build ID: 2749
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 0 of 848 Specs in 0.018 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 848 Skipped
PASS

Ginkgo ran 1 suite in 1m13.436445689s
Test Suite Passed
svcbot-qecnsdp commented 2 months ago

Started vanilla Block pipeline... Build Number: 2580

svcbot-qecnsdp commented 2 months ago
Block vanilla build status: SUCCESS 
Stage before exit: finally 
Jenkins E2E Test Results: 
------------------------------

Ran 6 of 848 Specs in 1344.153 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 842 Skipped
PASS

Ginkgo ran 1 suite in 23m30.972742822s
Test Suite Passed
svcbot-qecnsdp commented 2 months ago

Started vanilla file pipeline... Build Number: 1142

svcbot-qecnsdp commented 2 months ago
File vanilla build status: FAILURE 
Stage before exit: e2e-tests 
divyenpatel commented 2 months ago

/ok-to-test

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@nikhilbarge can you confirm there is no regression for file volume after this change?

nikhilbarge commented 2 months ago

@nikhilbarge can you confirm there is no regression for file volume after this change?

tested change with file volume RWX and RWO and verified volume mount is successful. added testing logs

divyenpatel commented 2 months ago

/lgtm

xiaoping8385 commented 2 months ago

Will this backport to old csi versions? @nikhilbarge ?