Skip to content

refactor: rsync and scp into copytool pkg#4521

Open
unsuman wants to merge 1 commit intolima-vm:masterfrom
unsuman:refactor/rsync
Open

refactor: rsync and scp into copytool pkg#4521
unsuman wants to merge 1 commit intolima-vm:masterfrom
unsuman:refactor/rsync

Conversation

@unsuman
Copy link
Contributor

@unsuman unsuman commented Jan 12, 2026

This PR refactors the file copying logic (rsync and scp) out of cmd/limactl and into a new package copytool.

Changes were made by creating a pkg/copytool with a common CopyTool interface, moving the rsync and scp command generation logic into this new package, and updating limactl copy and limactl shell to utilise the new package, which resulted in the removal of duplicated logic in shell.go.

Fixes

Yes, I think we should make a separate package rsync same as https://github.com/AkihiroSuda/alcless/blob/master/pkg/rsync/rsync.go
but this can be done by me in another PR?

Originally posted by @unsuman in #4429 (comment)

@unsuman
Copy link
Contributor Author

unsuman commented Jan 12, 2026

Left with the refactoring of rsync in the cmd/limactl/shell.go file with these current changes.
Since there exists bats testing for the copy and shell --sync command, is there a need to add unit tests for this new copytool package?

@AkihiroSuda
Copy link
Member

Needs rebase

@unsuman
Copy link
Contributor Author

unsuman commented Feb 9, 2026

I'll rebase it once #4563 is merged

@unsuman unsuman force-pushed the refactor/rsync branch 2 times, most recently from 3aa385a to ae6380f Compare February 16, 2026 10:13
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
@unsuman unsuman marked this pull request as ready for review February 16, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactoring Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants