-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[virtctl] Add a scp subcommand to virtctl #7441
Conversation
/retest |
/cc @dominikholler FYI |
/cc @0xFelix |
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.
Overall looks good to me. Just a remark about the recursive option and a nit about the import order.
Could this also be implemented with the local scp
binary wrapped like the local ssh
binary in the ssh client?
@rmohr Is there any chance to allow using the native scp command? |
I don't mind if someone wants to add it :) |
0cc4119
to
7ff32bc
Compare
/retest |
7fec7eb
to
f2e0e2b
Compare
/retest |
/retest |
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 think a bit of logic regarding files is missing.
pkg/virtctl/scp/scp.go
Outdated
return err | ||
} | ||
} else { | ||
err = scpClient.CopyFileToRemote(local.Path, remote.Path, &scp.FileTransferOption{PreserveProp: o.preserve}) |
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.
This could be a dir using CopyFileToRemote
. What would happen then?
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.
It will fail.
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.
With a comprehensible error message?
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.
Improved.
Yeah thanks for the detailed analysis. I think in the case of the |
/retest |
I have no concerns about the behavior. Only the error messages should be clear. |
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
copy-dir-to-remote: Fail with a clean error message early if the local path is not a directory. copy-dir-to-local: Create local directory if it does not exist or determine if a sub-directory needs to be created and create it. Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
👍 improved. |
/retest |
Great! 👍 /lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rmohr 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 |
/retest-required |
/retest |
/retest-required |
3 similar comments
/retest-required |
/retest-required |
/retest-required |
What this PR does / why we need it:
Allow copying files and directories between local machines and VMIs and VMs. The remote VMs need to have a running ssh server and scp installed.
Invocations may look like this:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: