diff options
author | Tim Smith <tsmith@chef.io> | 2020-06-23 10:39:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 10:39:11 -0700 |
commit | 89094f1a2b511aa69a021e4431dfdd14a88bd4d3 (patch) | |
tree | bfc22cfb941d1d08dabeaa1e62c9c1b7153d1d1a | |
parent | cc913f71378f0ad51ccac4334d75f262cd48ee7d (diff) | |
parent | d14e6bd2839d7d7ed72c395fd0cc63e38079c1d6 (diff) | |
download | chef-89094f1a2b511aa69a021e4431dfdd14a88bd4d3.tar.gz |
Merge pull request #10041 from chef/validatorless_bootstrap_15
Warn during bootstrapping when using validation keys
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 7 | ||||
-rw-r--r-- | spec/unit/knife/bootstrap_spec.rb | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 503c1c99ca..5e7ef5a28d 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -597,11 +597,8 @@ class Chef bootstrap_context.client_pem = client_builder.client_path else - ui.info <<~EOM - Performing legacy client registration with the validation key at #{Chef::Config[:validation_key]}... - Delete your validation key in order to use your user credentials for client registration instead. - EOM - + ui.warn "Performing legacy client registration with the validation key at #{Chef::Config[:validation_key]}..." + ui.warn "Remove the key file or remove the 'validation_key' configuration option from your config.rb (knife.rb) to use more secure user credentials for client registration." end end diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index 17c108378c..ea60657508 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -1747,8 +1747,8 @@ describe Chef::Knife::Bootstrap do allow(vault_handler_mock).to receive(:doing_chef_vault?).and_return false end - it "shows a message" do - expect(knife.ui).to receive(:info) + it "shows a warning message" do + expect(knife.ui).to receive(:warn).twice knife.register_client end end |