-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Do not fail volume attach or publish operation at kubelet if target path directory already exists on the node. #119735
Do not fail volume attach or publish operation at kubelet if target path directory already exists on the node. #119735
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Aug 2 10:20:21 UTC 2023. |
Welcome @akankshapanse! |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @akankshapanse. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
/assign @msau42 @jsafrane @andyzhangx |
b6ab720
to
cb600f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry if I confused you with my previous comments. I wanted just a function that checks for windows mount and then calls os.MkdirAll
, just like your original code.
Or do I miss anything?
pkg/util/filesystem/defaultfs.go
Outdated
// For windows NTFS, check if the path is symlink instead of directory. | ||
if err1 == nil && (dir.IsDir() || (dir.Mode()&os.ModeSymlink != 0)) { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already checked above.
pkg/util/filesystem/defaultfs.go
Outdated
} | ||
return &os.PathError{Op: "mkdir", Path: path, Err: syscall.ENOTDIR} | ||
} | ||
// Slow path: make sure parent exists and then call Mkdir for path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be safe safe to call os.MkdirAll
here, no need to reimplement it here.
@jsafrane do you mean the following? |
Yes. Just like the original fix, but in a common function. |
… already exists on windows worker node.
cb600f2
to
38935b7
Compare
Updated the diff as per your suggestion. |
Thanks for the patience! /lgtm |
LGTM label has been added. Git tree hash: c67ff8c273fc0e9db0fc15250b6a8a9490d8a876
|
/assign @dims |
/approve thanks @akankshapanse ! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akankshapanse, dims, jsafrane 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 |
/retest-required |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR addresses issue reported at #119401. This allows kubelet to ignore if the staging target directory or parent publish directory already exists and let corresponding CSI driver handle the situation.
Testing done:
Reproduced original issue seen in the bug mentioned above and after replacing kubelet with this fix, control was successfully passed to CSI driver, instead of failing the volume attach at kubelet level.
Which issue(s) this PR fixes:
#119401
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: