-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: correctly evaluate source path for '.' volume mounts #21403
base: main
Are you sure you want to change the base?
Conversation
- convert all paths starting with '.' to absolute (not just './') - remove unnecessary relative path logic in named volume check Signed-off-by: Reuben Lifshay <[email protected]>
Signed-off-by: Reuben Lifshay <[email protected]>
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: computator The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -112,7 +112,7 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na | |||
} | |||
} | |||
|
|||
if strings.HasPrefix(src, "/") || strings.HasPrefix(src, ".") || isHostWinPath(src) { |
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.
Although not broken, this check was not previously working as the author seemed to intend since it was only effective for '.'
exactly or for paths starting with '..'
. All other relative paths were resolved to absolute before getting to this point meaning that (with the previous exceptions) they only needed to check for the '/'
prefix.
A friendly reminder that this PR had no activity for 30 days. |
I'll get this added to my to-do list to finish up |
Fixes mounts like
-v .:/test
when the current directory is not the same as the directory where podman is run (I.E. remote only?). This does not do any remote path mapping or anything but it does make.
be treated the same as any other relative path like./xyz
(also fixes paths starting with..
). This doesn't change anything for hidden files or directories since anything starting with.
was already being converted to an absolute path.Does this PR introduce a user-facing change?
This PR is complete. I just need to figure out all the submission requirements.