chef-cookbooks / chef_client_updater

Chef Cookbook to update the chef client on nodes
https://supermarket.chef.io/cookbooks/chef_client_updater
Apache License 2.0
54 stars 79 forks source link

Latest release contains mac underscore files #239

Open petracvv opened 2 years ago

petracvv commented 2 years ago

This is a similar issue to chef-boneyard/sudo#156

The latest release contains . files in the tar archive that is available on supermarket.chef.io. When extracting this archive on a Mac, the BSD tar command there ignores those files when extracting into the cookbook cache causing policyfile checksums to be generated incorrectly. This causes errors when trying to run the policy on machines/OS's that don't ignore the .* files (such as linux servers you are deploying to).

In this repository I see the following in the extracted tar:

$ find . -name '._*'
./._LICENSE
./resources/._default.rb
./libraries/._matchers.rb
./libraries/._chef_client_updater_helper.rb
./._README.md
./attributes/._default.rb
./recipes/._default.rb
./._chefignore
./._kitchen.dokken.yml

Since this is the second cookbook I've seen with this issue, perhaps there is some bug in your supermarket push procedure? Either way, those files shouldn't be in the tar release.

The workaround to this is to manually extract the correct version of the cookbook into your policyfile cookbook cache using GNU tar so that the ._* files are extracted as well. Then the checksums will be the same on your machine and any non-Mac machines you are deploying to.

pdohertybcov commented 2 years ago

I'm also seeing this same error with the latest (3.12.1) release.

tas50 commented 2 years ago

I've released 3.12.2. Let me know if that resolves the problems

petracvv commented 2 years ago

I am no longer seeing policyfile errors with the latest version so i think this is fixed.