-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add podman machine cp
subcommand
#25331
Conversation
0e3d563
to
18304ce
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.
Note we generally squash all commits into one for a new feature, i.e. code, docs, test should be in one commit. Of course if there are doing different features/bugs then not but in this case it is only one.
914a438
to
55cf202
Compare
55cf202
to
076256f
Compare
eaf21be
to
0ed0ba3
Compare
one question i guess else LGTM |
0ed0ba3
to
eed8e8f
Compare
602102f
to
b7b6dc7
Compare
} | ||
|
||
// Passing an absolute windows path of the format <volume>:\<path> will cause | ||
// `copy.ParseSourceAndDestination` to think the volume is a Machine. Check |
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.
just thinking about it does podman cp
not have the exact same issue, i.e. should this fix be moved into ParseSourceAndDestination()?
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.
Wouldn't that result in the same issue mentioned below having to do with single name containers?
cmd/podman/machine/cp.go
Outdated
if specgen.IsHostWinPath(args[0]) { | ||
srcMachine = "" | ||
srcPath = args[0] | ||
} | ||
|
||
if specgen.IsHostWinPath(args[1]) { | ||
destMachine = "" | ||
destPath = args[1] | ||
} |
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.
Also isn't this breaking for machine names with one letter? i.e. I think it runs into the same issue as shown in #25323
We do allow a machine called C
so that can be a problem although super unlikely that anyone would be using single letter machine names hopefully so I am fine to ignore that part for now. Though adding this issue in a comment here might help future readers.
f99e5fe
to
a69cc67
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jakecorrenti, Luap99 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 |
directory = "foo-dir" | ||
directoryPath = filepath.Join(GinkgoT().TempDir(), directory) | ||
|
||
fileInDirectory = "bar.txt" |
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.
For some reason tests are failing during cleanup for me on Windows because this file cannot be removed. The error message is "The process cannot access the file because it is being used by another process.". This can be specific to my machine though.
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'm relying on the CI for my windows machine, but I'll keep an eye on it.
a69cc67
to
4fec981
Compare
b775a29
to
9e12f5c
Compare
Add a new `podman machine cp` subcommand to allow users to copy files or directories between a running Podman Machine and their host. Tests cover the following cases: - Copy a file from the host machine to the VM - Copy a directory from the host machine to the VM - Copy a file from the VM to the host machine - Copy a directory from the VM to the host machine - Copy a file to a directory - Copy a directory to a file Signed-off-by: Jake Correnti <[email protected]>
9e12f5c
to
42fb942
Compare
/lgtm |
Does this PR introduce a user-facing change?
Adds a new
podman machine cp
subcommand. This will allow users to copy files or directories between a running Podman Machine and their host.