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

feat: support RemoveSmbGlobalMapping during unmount on Windows node #505

Merged
merged 1 commit into from
Aug 13, 2022

Conversation

vitaliy-leschenko
Copy link
Contributor

@vitaliy-leschenko vitaliy-leschenko commented Jun 29, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR implement SMBUnmount method to call RemoveSmbGlobalMapping from csi-proxy

Which issue(s) this PR fixes:
Currently no one calls RemoveSmbGlobalMapping

Special notes for your reviewer:
Make sense to see together with kubernetes-csi/csi-proxy#210

Release note:

Calls RemoveSmbGlobalMapping when it necessary

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @vitaliy-leschenko. Thanks for your PR.

I'm waiting for a kubernetes-csi 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 29, 2022
@coveralls
Copy link

coveralls commented Jun 29, 2022

Pull Request Test Coverage Report for Build 2827044432

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 85.445%

Totals Coverage Status
Change from base Build 2802564516: 0.3%
Covered Lines: 816
Relevant Lines: 955

💛 - Coveralls

@andyzhangx
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 Jun 29, 2022
@vitaliy-leschenko vitaliy-leschenko changed the title implement SMBUnmount implement SMBUnmount for Windows Jun 29, 2022
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 30, 2022
@vitaliy-leschenko vitaliy-leschenko changed the title implement SMBUnmount for Windows Calls RemoveSmbGlobalMapping when it necessary Jun 30, 2022
@vitaliy-leschenko
Copy link
Contributor Author

/assign @andyzhangx

@vitaliy-leschenko vitaliy-leschenko changed the title Calls RemoveSmbGlobalMapping when it necessary [WIP] Calls RemoveSmbGlobalMapping when it necessary Jun 30, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2022
@vitaliy-leschenko
Copy link
Contributor Author

vitaliy-leschenko commented Jun 30, 2022

As I see in logs SMBUnmount calls twice:

I0629 21:49:06.107793    8176 safe_mounter_windows.go:117] SMBUnmount: local path: c:\var\lib\kubelet\pods\333c440a-ffc8-421e-9d45-e04aff8a9d34\volumes\kubernetes.io~csi\pv-smb\mount
I0629 21:49:41.004132    8176 safe_mounter_windows.go:148] Remove directory: c:\var\lib\kubelet\pods\dec84d2f-d2e2-4f1e-ab72-1a3a5dd33845\volumes\kubernetes.io~csi\pv-smb\mount

I0629 21:49:43.479884    8176 safe_mounter_windows.go:117] SMBUnmount: local path: \var\lib\kubelet\plugins\kubernetes.io\csi\pv\pv-smb\globalmount
I0629 21:49:43.479884    8176 safe_mounter_windows.go:148] Remove directory: \var\lib\kubelet\plugins\kubernetes.io\csi\pv\pv-smb\globalmount

We need to call RemoveSmbGlobalMapping only for second case. I will do it.


Update: fixed

@vitaliy-leschenko vitaliy-leschenko changed the title [WIP] Calls RemoveSmbGlobalMapping when it necessary Calls RemoveSmbGlobalMapping when it necessary Jun 30, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2022
@vitaliy-leschenko vitaliy-leschenko changed the title Calls RemoveSmbGlobalMapping when it necessary [WIP] Calls RemoveSmbGlobalMapping when it necessary Jun 30, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2022
@vitaliy-leschenko vitaliy-leschenko changed the title [WIP] Calls RemoveSmbGlobalMapping when it necessary Calls RemoveSmbGlobalMapping when it necessary Jun 30, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2022
@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 Jul 31, 2022
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/safe_mounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/safe_mounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/safe_mounter_windows.go Outdated Show resolved Hide resolved
@vitaliy-leschenko vitaliy-leschenko force-pushed the smb-unmount branch 2 times, most recently from 67a3b6c to db95f3d Compare August 6, 2022 19:16
pkg/mounter/safe_mounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Outdated Show resolved Hide resolved
pkg/mounter/refcounter_windows.go Show resolved Hide resolved
@vitaliy-leschenko
Copy link
Contributor Author

@andyzhangx currently we run unit tests with old csi-proxy: https://acs-mirror.azureedge.net/csi-proxy/v1.1.1/binaries/csi-proxy-v1.1.1.tar.gz
Can you build new csi-proxy to try run tests on both of proxies?

@andyzhangx
Copy link
Member

@andyzhangx currently we run unit tests with old csi-proxy: https://acs-mirror.azureedge.net/csi-proxy/v1.1.1/binaries/csi-proxy-v1.1.1.tar.gz Can you build new csi-proxy to try run tests on both of proxies?

@vitaliy-leschenko does this PR depend on master branch csi-proxy?

@vitaliy-leschenko
Copy link
Contributor Author

vitaliy-leschenko commented Aug 8, 2022

@vitaliy-leschenko does this PR depend on master branch csi-proxy?

No, but I want to be 100% sure.

@vitaliy-leschenko vitaliy-leschenko force-pushed the smb-unmount branch 2 times, most recently from 35d6117 to 0adbe2c Compare August 8, 2022 14:28
@vitaliy-leschenko vitaliy-leschenko force-pushed the smb-unmount branch 3 times, most recently from 5c67dfa to 5035baf Compare August 9, 2022 15:06
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
thanks for the contribution!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, vitaliy-leschenko

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:

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit eb9ddbc into kubernetes-csi:master Aug 13, 2022
@andyzhangx andyzhangx changed the title Calls RemoveSmbGlobalMapping when it necessary feat: support RemoveSmbGlobalMapping during unmount on Windows node Aug 13, 2022
@vitaliy-leschenko vitaliy-leschenko deleted the smb-unmount branch August 15, 2022 12:05
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. kind/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants