chef / cookbook-omnifetch

Fetch Chef Cookbooks from Various Sources to a Local Cache
Apache License 2.0
6 stars 9 forks source link

Change cache validation to always check sums #33

Closed marcparadise closed 4 years ago

marcparadise commented 4 years ago

Update cache validation to always check the checksums of individual files instead of assuming that the content is correct if the directory is present. This will also remove any files that should not be in the cache directory.

Combined, these changes give a better chance that uploaded artifact will match the downloaded cookbook.

Reference https://github.com/chef/chef-workstation/issues/1273#issuecomment-675566249 for details.

Signed-off-by: Marc A. Paradise marc.paradise@gmail.com

marcparadise commented 4 years ago

This approach does affect chef-cli because it will always see these cookbooks as not cached - so instead of Using #{cookbook_name} it will always report Installing #{cookbook_name}.

marcparadise commented 4 years ago

I'll need to update this to not use :base in Dir.glob; that was introduced in ruby 2.5, so is causing failure in 2.4.

tas50 commented 4 years ago

If you want to just drop 2.4 support that seems fine at this point

marcparadise commented 4 years ago

If you want to just drop 2.4 support that seems fine at this point

I've already made the update, it's six/half dozen. That said, I'll drop 2.4 too; I think most of our stuff has a 2.5 min at this point. I'll do that in a separate PR though