summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index ffc36436ec..f7fee023de 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -30,7 +30,7 @@ class Chef
#
class BootstrapContext
- def initialize(config, run_list, chef_config, secret)
+ def initialize(config, run_list, chef_config, secret = nil)
@config = config
@run_list = run_list
@chef_config = chef_config
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index af8fa3f698..e7d2464fa1 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -34,6 +34,10 @@ describe Chef::Knife::Core::BootstrapContext do
subject(:bootstrap_context) { described_class.new(config, run_list, chef_config, secret) }
+ it "initializes with Chef 11 parameters" do
+ expect{described_class.new(config, run_list, chef_config)}.not_to raise_error
+ end
+
it "runs chef with the first-boot.json in the _default environment" do
expect(bootstrap_context.start_chef).to eq "chef-client -j /etc/chef/first-boot.json -E _default"
end