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

getfile on windows: when a file cannot be symlinked for privilege reasons, copy it #159

Merged
merged 3 commits into from
Feb 4, 2019

Conversation

azr
Copy link
Contributor

@azr azr commented Jan 29, 2019

Symlinking allows to optimize the space taken by go-get in case the operation runs locally.
But running the go getter without the symlinking privilege can fail in this case.

This will copy the file instead of symlinking it in case we don't have the priviledge, so that the go-get doesn't fail.

closes #39
related: hashicorp/nomad#3491


This could also be an option passed to the client ? That we could turn on/off.

…no privilege, copy it

Symlinking allows to optimize the space taken by go-get in case the operation runs locally.
But running the go getter without the symlinking privilege can fail in this case.

This will copy the file instead of symlinking it in case we don't have the priviledge.
@azr azr added the windows label Jan 29, 2019
@azr
Copy link
Contributor Author

azr commented Jan 29, 2019

Another fix for this would be to have the go-getter do nothing and find a way to tell the caller that the file is local so that the caller can use it in place.

Like a if err == getter.ErrLocalGet or by returning an 'operation': op, err := getter.Get(

@mitchellh
Copy link
Contributor

This feels totally fine? I'd be fine changing the documentation for Copy to "If false, attempts to symlink to speed up local files. If the symlink fails, may attempt to copy."

@azr
Copy link
Contributor Author

azr commented Jan 30, 2019

I have the same feeling you have, it feels fine. Here we go about the doc update 🙂.

@azr azr mentioned this pull request Jan 30, 2019
9 tasks
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.

local transfer required special privileges on Windows
2 participants