Skip to content

Conversation

metmikel
Copy link

…, 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.

…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.
@metmikel metmikel requested a review from a team as a code owner August 20, 2024 05:11
Copy link

hashicorp-cla-app bot commented Aug 20, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@SBGoods SBGoods left a 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!

@metmikel
Copy link
Author

Hi @SBGoods,
Apologies for the long delay replying. I was hoping to make the changes you suggested, but I have to confess that this is the first time I have done anything in Go and while I was hoping to do some learning in that area, work commitments have got in the way. Hopefully somebody else who is impacted by this issue will be able to pick it up.

@jiw-mh
Copy link

jiw-mh commented Jul 8, 2025

@metmikel
Does this also need to be added to the tar archiver?

@metmikel
Copy link
Author

metmikel commented Jul 9, 2025

@metmikel Does this also need to be added to the tar archiver?

@jiw-mh Yes, agreed, it seems to follow the same pattern there. (There is also a redundant check at line 144 - err is checked prior to that at line 129).

@metmikel metmikel requested a review from a team as a code owner July 9, 2025 20:57
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.

3 participants