summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2019-05-17 15:34:52 -0400
committerBryan McLellan <btm@loftninjas.org>2019-05-17 15:35:48 -0400
commitf5f0f730969255851bd7e9f57a421e791b8bd034 (patch)
treedf46367372d8198309100e16282569fdc4975952 /lib
parent7bb95d133a81af47e70a018cd6081da2f9f87dc8 (diff)
downloadchef-f5f0f730969255851bd7e9f57a421e791b8bd034.tar.gz
Only set client_pem in bootstrap_context when validatorlessbtm/client_key_validator_fix
We should only set bootstrap_context.client_pem if we're a validatorless bootstrap. Fixes #8534 Signed-off-by: Bryan McLellan <btm@loftninjas.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/bootstrap.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 66d73a3372..2a9eab6f8e 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -546,9 +546,6 @@ class Chef
register_client
connect!
- unless client_builder.client_path.nil?
- bootstrap_context.client_pem = client_builder.client_path
- end
content = render_template
bootstrap_path = upload_bootstrap(content)
perform_bootstrap(bootstrap_path)
@@ -569,6 +566,8 @@ class Chef
end
client_builder.run
chef_vault_handler.run(client_builder.client)
+
+ 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]}...