Search code examples
chef-infraberkshelf

How to unfreeze cookbook


I discovered the ability to freeze a cookbook in chef accidentally through berks upload. It does sound great to be able to prevent changes and uploads to a cookbook. But...

How do you unfreeze a cookbook? I couldn't find any documentation or any posts asking this. It might sound counter-intuitive as to why, why would you want to do that...? You released your cookbook, you shouldn't make history changes.

What if though, you had a production emergency and the cookbook of that version broke everything. First answer might be, move forward and fix the issue --- but that could take awhile. Second answer might be, change the version pinned to the previous --- but what if you have 50 cookbooks pinned to that version? Also not practical.

Seems pretty useful to be able to unfreeze something. Yes, you can use the -f option to force the update. But having to force update every change in the future ad infinitum sounds janky and not proper. Especially when someone has accidentally frozen a cookbook (such as in my case).


Solution

  • You can force-upload a new version with the freeze flag set to false. We do not specifically expose this or make it easy since it kind of defeats the point. The better solution is to either use SemVer pinning rather than single versions or use the newer Policyfile system.