summaryrefslogtreecommitdiff
path: root/lib/chef/deprecated.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-04-09 13:28:17 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-04-17 10:20:31 -0700
commitd7452360adb80e383b4886246990dbe46d3387c2 (patch)
tree1d4391bc389a25024fab40ea501745d3e5c8f9dc /lib/chef/deprecated.rb
parentac47427ab7090453a680c6c4cf6d32eb85cb270d (diff)
downloadchef-d7452360adb80e383b4886246990dbe46d3387c2.tar.gz
Knife bootstrap options cleanup
We have issue that are caused by old code before merging of hash values were done correctly. The `config` hash correctly merges all options and should always be used. Knife plugins should never touch Chef::Config[:knife] values (either reading or writing from them). The `knife_config` should be converted to the `config` hash since it directly accesses Chef::Config[:knife] values. The `config_value()` helper should no longer be used. Very clearly most people started to use that when they should just use the config hash directly. That was intended to be used only when a knife cli option was being renamed and the former configuration value needed to be used as well. It has been cargo culted around as the way to access config values, and that should really stop. The DataBagSecretOption mixin has been cleaned up so that the cli options read+write only to the config[:cl_secret] and config[:cl_secret_file] values. The config file values go into config[:secret] and config[:secret_file]. The fact that those are the merged values in the `config` hash doesn't matter since only the cli should be writing to the first two and only the config file should be writing to the latter two. I don't know why it was made so complicated to begin with, but if there's some hidden chef-11.early backcompat there, then chef-16 deliberately breaks that. The use of `locate_config_value` helpers in all knife plugins is also discouraged (but they all implement those themselves), just use the config hash, which has the correct hash merge ordering. All of those need to be deleted. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/deprecated.rb')
-rw-r--r--lib/chef/deprecated.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb
index 7062e27aab..ecc589d263 100644
--- a/lib/chef/deprecated.rb
+++ b/lib/chef/deprecated.rb
@@ -233,6 +233,10 @@ class Chef
target 28
end
+ class KnifeBootstrapApis < Base
+ target 29
+ end
+
class Generic < Base
def url
"https://docs.chef.io/chef_deprecations_client/"