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

fix: Use configured host URL when fetching docker information (#321) #323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion lib/kitchen/driver/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class Dokken < Kitchen::Driver::Base
default_config :dns, nil
default_config :dns_search, nil
default_config :docker_host_url, default_docker_host
default_config :docker_info, docker_info
default_config :docker_info do |driver|
docker_info(driver[:docker_host_url])
end
default_config :docker_registry, nil
default_config :entrypoint, nil
default_config :env, nil
Expand Down
4 changes: 2 additions & 2 deletions lib/kitchen/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def default_docker_host
end
end

def docker_info
::Docker.url = default_docker_host
def docker_info(docker_host)
::Docker.url = docker_host

@docker_info ||= ::Docker.info
rescue Excon::Error::Socket
Expand Down
4 changes: 3 additions & 1 deletion lib/kitchen/provisioner/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class Dokken < Kitchen::Provisioner::ChefZero
default_config :chef_log_level, "warn"
default_config :chef_output_format, "doc"
default_config :profile_ruby, false
default_config :docker_info, docker_info
default_config :docker_info do |provisioner|
docker_info(provisioner[:docker_host_url])
end
default_config :docker_host_url, default_docker_host

# Dokken is weird - the provisioner inherits from ChefZero but does not install
Expand Down
4 changes: 3 additions & 1 deletion lib/kitchen/transport/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class Dokken < Kitchen::Transport::Base

plugin_version Kitchen::VERSION

default_config :docker_info, docker_info
default_config :docker_info do |transport|
docker_info(transport[:docker_host_url])
end
default_config :docker_host_url, default_docker_host
default_config :read_timeout, 3600
default_config :write_timeout, 3600
Expand Down