Chef Deprecation Warnings

[edit on GitHub]

When we wish to remove a feature or an API in Chef, we try to first mark it with a deprecation warning that contains a link to a description of the change and how to fix it. For example:

Deprecated features used!
  JSON auto inflation is not supported (CHEF-1) at (irb):7:in `irb_binding`.
  Please see /chef-client/deprecations/json_auto_inflate.html for further details and information on how to correct this problem.

Testing for Deprecations

To test your code for deprecations, you can put Test Kitchen in a mode where any deprecations cause the chef run to fail. Ensure your .kitchen.yml includes:

  deprecations_as_errors: true

and then run Test Kitchen as usual. Test Kitchen will fail if any deprecation errors are issued. This feature was added in Test Kitchen 1.13, which shipped in ChefDK 1.0.

All Deprecations

ID Description Deprecated Expected Removal
CHEF-0 Many internal APIs have been improved. various varies
CHEF-1 Consumers of JSON are now required to be explicit in how it is turned in to a Chef object. 12.7 13.0
CHEF-2 Chef’s exit codes are now defined so that it’s easy to understand why Chef exited. 12.11 13.0
CHEF-3 When using the chef_gem resource, the phase to install the gem in must be specified. 12.1 13.0
CHEF-4 Various improvements have been made to attribute syntax. various varies
CHEF-5 Various improvements have been made to custom resource syntax. various varies
CHEF-6 The easy_install resource will be removed. 12.10 13.0
CHEF-7 The verify metaproperty’s file substitution will be removed. 12.5 13.0
CHEF-8 The supports metaproperty will be removed. 12.14 13.0
CHEF-9 The Chef::REST API will be removed. 12.7 13.0
CHEF-10 DNF package provider and resource do not require --allow-downgrade anymore. 12.18 13.0
CHEF-11 An exception will be raised if a resource property conflicts with an already-existing property or method. 12.19 13.0
CHEF-12 An exception will be raised whenever the hash property in the launchd resource is used. 12.19 13.0
CHEF-13 Deprecated Chef::Platform methods 12.18 13.0
CHEF-14 Deprecation of run_command 12.18 13.0
CHEF-3694 Resource Cloning will no longer work. 10.18 13.0
OHAI-1 Ohai::Config removal. 12.6 13.0
OHAI-2 Sigar gem based plugins removal. 12.19 13.0
OHAI-3 run_command and popen4 helper method removal. 12.8 13.0
OHAI-4 Libvirt plugin attributes changes. 12.19 14.0
OHAI-5 Windows CPU plugin attribute changes. 12.19 13.0
OHAI-6 DigitalOcean plugin attribute changes. 12.19 13.0
OHAI-7 Amazon linux moved to the Amazon platform_family. 13.0 13.0
OHAI-8 Cloud plugin replaced by the Cloud_V2 plugin. 13.0 13.0
OHAI-9 Filesystem plugin replaced by the Filesystem V2 plugin. 13.0 13.0
OHAI-10 Removal of support for Ohai version 6 plugins. 11.12 14.0
OHAI-11 Cloud_v2 attribute removal. 13.1 15.0
OHAI-12 Filesystem2 attribute removal. 13.1 15.0