forked from test-kitchen/kitchen-dokken
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "support chef image based on client version specified"
This reverts commit f015bfb.
- Loading branch information
Showing
4 changed files
with
27 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,14 @@ | |
module Kitchen | ||
module Provisioner | ||
# @author Sean OMeara <[email protected]> | ||
class Dokken < Kitchen::Provisioner::ChefInfra | ||
class Dokken < Kitchen::Provisioner::ChefZero | ||
kitchen_provisioner_api_version 2 | ||
|
||
plugin_version Kitchen::VERSION | ||
|
||
default_config :root_path, "/opt/kitchen" | ||
default_config :chef_binary, "#{chef_bin_path}/chef-client" | ||
default_config :hab_binary, "/hab/bin/hab" | ||
default_config :chef_binary, "/opt/chef/bin/chef-client" | ||
default_config :hab_chef_binary, "/hab/hab" | ||
default_config :chef_options, " -z" | ||
default_config :chef_log_level, "warn" | ||
default_config :chef_output_format, "doc" | ||
|
@@ -101,16 +101,15 @@ def validate_config | |
# patching Kitchen::Provisioner::ChefZero#run_command | ||
def run_command | ||
validate_config | ||
cmd = config[:chef_binary] | ||
cmd = chef_executable | ||
cmd << config[:chef_options].to_s | ||
cmd << " -l #{config[:chef_log_level]}" | ||
cmd << " -F #{config[:chef_output_format]}" | ||
cmd << " -c /opt/kitchen/client.rb" | ||
cmd << " -j /opt/kitchen/dna.json" | ||
cmd << " --profile-ruby" if config[:profile_ruby] | ||
cmd << " --slow-report" if config[:slow_resource_report] | ||
cmd << " --chef-license-key=#{config[:chef_license_key]}" if config[:chef_license_key] | ||
cmd << " --chef-license-server=#{config[:chef_license_server]}" unless config[:chef_license_server].empty? | ||
cmd << " --chef-license-key=#{config[:chef_license_key]}" if instance.driver.installer == "habitat" && config[:chef_license_key] | ||
|
||
chef_cmd(cmd) | ||
end | ||
|
@@ -129,6 +128,12 @@ def cleanup_dokken_sandbox | |
debug("Cleaning up local sandbox in #{sandbox_path}") | ||
FileUtils.rmtree(Dir.glob("#{sandbox_path}/*")) | ||
end | ||
|
||
def chef_executable | ||
return "HAB_LICENSE='accept-no-persist' #{config[:hab_chef_binary]} pkg exec chef/chef-infra-client -- chef-client " if instance.driver.installer == "habitat" | ||
|
||
"#{config[:chef_binary]}" | ||
end | ||
end | ||
end | ||
end |