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

fix: correctly evaluate source path for '.' volume mounts #21403

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

computator
Copy link

@computator computator commented Jan 29, 2024

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.

  • convert all paths starting with '.' to absolute (not just './')
  • remove unnecessary relative path logic in named volume check

Does this PR introduce a user-facing change?


This PR is complete. I just need to figure out all the submission requirements.

- 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]>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 29, 2024
Copy link
Contributor

openshift-ci bot commented Jan 29, 2024

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.

@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Jan 29, 2024
Copy link
Contributor

openshift-ci bot commented Jan 29, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: computator
Once this PR has been reviewed and has the lgtm label, please assign mheon for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -112,7 +112,7 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na
}
}

if strings.HasPrefix(src, "/") || strings.HasPrefix(src, ".") || isHostWinPath(src) {
Copy link
Author

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.

Copy link

A friendly reminder that this PR had no activity for 30 days.

@computator
Copy link
Author

I'll get this added to my to-do list to finish up

@github-actions github-actions bot removed the stale-pr label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant