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

`knife upload` not respecting cookbook chefignore file #8109

Open
shoekstra opened this Issue Jan 14, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@shoekstra
Copy link
Contributor

shoekstra commented Jan 14, 2019

Ohai!

It seems in recent version of chef that knife (and berks) no longer respect the chefignore file in a cookbook directory when uploading cookbooks to a chef server.

I use chef-guard to enforce a cookbook upload contains the same content as it's supermarket artifact when freezing. It does this by fetching the artifact from the supermarket and compare what is uploaded by knife to the artifact for differences.

When trying to freeze with recent chef versions I now receive errors:

$ knife cookbook upload certificate_services --freeze
Uploading certificate_services [0.1.0]
ERROR: Precondition Failed
Response:
=== Cookbook Compare errors found ===
Your upload contains more files than the source cookbook:
 - Gemfile
 - LICENSE
 - chefignore
 - tags

Source: https://supermarket.chef.io/api/v1/cookbooks/certificate_services/versions/0.1.0/download
=====================================

$ rm Gemfile LICENSE chefignore tags
$ knife cookbook upload certificate_services --freeze
Uploading certificate_services [0.1.0]
ERROR: Precondition Failed
Response:
=== Cookbook Compare errors found ===
Your upload contains more files than the source cookbook:
 - .gitignore
 - .kitchen.yml
 - .rspec
 - Berksfile

Source: https://supermarket.chef.io/api/v1/cookbooks/certificate_services/versions/0.1.0/download
=====================================

$ rm .gitignore .kitchen.yml .rspec Berksfile
$ knife cookbook upload certificate_services --freeze
Uploading certificate_services [0.1.0]
ERROR: Precondition Failed
Response:
=== Cookbook Compare errors found ===
Your upload contains more files than the source cookbook:
 - Berksfile.lock

Source: https://supermarket.chef.io/api/v1/cookbooks/certificate_services/versions/0.1.0/download
=====================================

$ rm Berksfile.lock
$ knife cookbook upload certificate_services --freeze
Uploading certificate_services [0.1.0]
Uploaded 1 cookbook.

All mentioned files are matched in my chefignore which leads me to believe something has changed in the cookbook upload process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment