-
Notifications
You must be signed in to change notification settings - Fork 64
361: Don't return filepath.SkipDir from the WalkFunc when excluding symlinked directories… #362
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
base: main
Are you sure you want to change the base?
361: Don't return filepath.SkipDir from the WalkFunc when excluding symlinked directories… #362
Conversation
…ymlinked directories, as the item at the path being processed is a symlink and according to https://pkg.go.dev/path/filepath#WalkFunc, returning filepath.SkipDir from WalkFunc when the item being processed is not a directory will skip the parent directory - which is not the desired behavior.
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.
Hi @metmikel 👋🏾,
Thank you for submitting this PR. The change and rationale here makes sense to me. Before approving this PR, though, is it possible to add a unit test case in zip_archiver_test.go
and acceptance test cases in resource_archive_file_zip_test.go
and data_source_archive_file_zip_test.go
?
Also it looks like this issue also affects tar_achiver.go
, so if you would like to make corresponding changes/tests for the tar archiver that would be appreciated! If not, no worries, I'll open up a follow up PR after merging this one.
Thanks!
Hi @SBGoods, |
@metmikel |
…und. Also removed a redundant check of the err value.
…tps://github.com/metmikel/terraform-provider-archive into 361_exclude_symlink_directories_skips_other_dirs
…, as the item at the path being processed is a symlink and according to https://pkg.go.dev/path/filepath#WalkFunc, returning filepath.SkipDir from WalkFunc when the item being processed is not a directory will skip the parent directory - which is not the desired behavior.