Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing dokken provisioner from chef zero to chef infra #227

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ test/version_tmp
tmp
.kitchen
.librarian
.idea/
10 changes: 5 additions & 5 deletions lib/kitchen/provisioner/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
# limitations under the License.

require "kitchen"
require "kitchen/provisioner/chef_zero"
require "kitchen/provisioner/chef_infra"
require_relative "../helpers"

include Dokken::Helpers

module Kitchen
module Provisioner
# @author Sean OMeara <sean@sean.io>
class Dokken < Kitchen::Provisioner::ChefZero
class Dokken < Kitchen::Provisioner::ChefInfra
kitchen_provisioner_api_version 2

plugin_version Kitchen::VERSION
Expand All @@ -38,14 +38,14 @@ class Dokken < Kitchen::Provisioner::ChefZero
default_config :docker_info, docker_info
default_config :docker_host_url, default_docker_host

# Dokken is weird - the provisioner inherits from ChefZero but does not install
# Dokken is weird - the provisioner inherits from ChefInfra but does not install
# chef-client. The version of chef used is customized by users in the driver
# section since it is just downloading a specific Docker image of Chef Client.
# In order to get the license-acceptance code working though (which depends on
# the product_version from the provisioner) we need to copy the value from the
# driver and set it here. If we remove this, users will set their chef_version
# to 14 in the driver and still get prompted for license acceptance because
# the ChefZero provisioner defaults product_version to 'latest'.
# the ChefInfra provisioner defaults product_version to 'latest'.
default_config :product_name, "chef"
default_config :product_version do |provisioner|
driver = provisioner.instance.driver
Expand Down Expand Up @@ -99,7 +99,7 @@ def validate_config

private

# patching Kitchen::Provisioner::ChefZero#run_command
# patching Kitchen::Provisioner::ChefInfra#run_command
def run_command
validate_config
cmd = config[:chef_binary]
Expand Down