What is the difference of using the -E flag on knife upload cookbook


#1

What is the difference of using the -E flag on knife upload cookbook

knife cookbook upload supervisor -E production
knife cookbook upload supervisor -E development
knife cookbook upload supervisor

Before I used to use knife cookbook upload supervisor -E development and it
worked for production and development. Now…some cookooks dont work in
production now unless I upload using with the -E flag.

Did opscode just make a change?

This will cause me some issues to what it the proper method to use
cookbooks that are environment neutral. As of now…stuff is breaking

Thanks


#2

On Friday, November 15, 2013 at 4:21 PM, David Montgomery wrote:

What is the difference of using the -E flag on knife upload cookbook

knife cookbook upload supervisor -E production
knife cookbook upload supervisor -E development
knife cookbook upload supervisor

Before I used to use knife cookbook upload supervisor -E development and it worked for production and development. Now…some cookooks dont work in production now unless I upload using with the -E flag.

Did opscode just make a change?

This will cause me some issues to what it the proper method to use cookbooks that are environment neutral. As of now…stuff is breaking

Thanks
It’s described a little bit here: http://www.opscode.com/blog/2011/04/21/chef-0-10-preview-environments/ (unfortunately, the formatting on code examples got mangled in a blog upgrade somewhere).

The main distinction is:

Adding the -E ENVIRONMENT option will cause knife to automatically set the version constraint on that environment to match the version you’re uploading.

So the answer to your original question probably lies in the version numbers of your cookbooks and the constraints getting set in the environments. You can explore this with knife environment show ENVIRONMENT and looking at the cookbook’s metadata file for the version number.


Daniel DeLeo