-
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jakecorrenti 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 |
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
pkg/machine/e2e/cp_test.go
Outdated
if testProvider.VMType() == define.AppleHvVirt { | ||
Expect(session.errorToString()).To(ContainSubstring(fmt.Sprintf("scp: open local \"%s\": No such file or directory", hostDirPath))) | ||
} else { | ||
Expect(session.errorToString()).To(ContainSubstring(fmt.Sprintf("scp: open local \"%s\": Is a directory", hostDirPath))) | ||
} |
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 don't have a windows machine accessible at the moment, so I still need to figure out the error message checking here (I should also be checking if GOOS is macos not the provider here...)
eaf21be
to
0ed0ba3
Compare
one question i guess else LGTM |
0ed0ba3
to
eed8e8f
Compare
ea13c54
to
602102f
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]>
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?
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.
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.