-
Notifications
You must be signed in to change notification settings - Fork 218
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 cp arg expansion bug in cloning implementation #82
Conversation
The cloning implementation for hostpath volumes used `args := []string{"-a", srcPath + "/*", destPath + "/"}` The result is some shells will actually try to find/copy a file `*` from the source directory. We need to use the cp specific syntax for this instead `.`, to guarantee that things work on different platforms and shells.
/assign @msau42 |
@@ -293,7 +293,7 @@ func loadFromVolume(srcVolumeId, destPath string) error { | |||
|
|||
// If the source hostpath volume is empty it's a noop and we just move along, otherwise the cp call will fail with a a file stat error DNE | |||
if !isEmpty { | |||
args := []string{"-a", srcPath + "/*", destPath + "/"} | |||
args := []string{"-a", srcPath + "/.", destPath + "/"} |
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.
do you need -R?
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.
Nah, -a
is the equivalent of -dR
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: j-griffith, msau42 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 |
What type of PR is this?
bug
What this PR does / why we need it:
The clone implementation is just using
cp /*
can result in trying to actually find/copy a file named*
. The result in some container images is a stat error for no such file or directory. Instead we should be using the cp notation of/.
so we're portable and always work.Which issue(s) this PR fixes:
Fixes #81
Special notes for your reviewer:
Does this PR introduce a user-facing change?: