Skip to content
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: file provisioner does not transfer folders #39

Merged
merged 2 commits into from
Jul 6, 2022
Merged

Conversation

devashish-patel
Copy link
Contributor

  • The upload directory function currently adds /. at the end of the source path, which changes the behavior of the cp.
  • The change in this PR relies on the user input if the source ends with /. we only copy the content of the directory otherwise the while source directory to the destination.

Resolves #31

@devashish-patel devashish-patel requested a review from a team as a code owner June 30, 2022 16:24
@hashicorp-cla
Copy link

hashicorp-cla commented Jun 30, 2022

CLA assistant check
All committers have signed the CLA.

@devashish-patel devashish-patel self-assigned this Jun 30, 2022
@devashish-patel devashish-patel changed the title fix: directory copy fix: file provisioner does not transfer folders Jun 30, 2022
Copy link
Member

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Copy link
Member

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the documented behavior for the file provisioner when running on lxc. With this change source directories with the trailing slash copies the parent source directory along with its contents. But it should only copy the contents.

builder/lxc/communicator.go Show resolved Hide resolved
@nywilken nywilken added the bug label Jul 6, 2022
Copy link
Member

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. The changes look good.

@nywilken nywilken merged commit 5b69a50 into main Jul 6, 2022
@nywilken nywilken deleted the dpatel/31-dir-copy branch July 6, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File provisioner does not transfer folders
4 participants