Class: Kitchen::Transport::Dokken
- Inherits:
-
Base
- Object
- Base
- Kitchen::Transport::Dokken
- Defined in:
- lib/kitchen/transport/dokken.rb
Overview
A Transport which uses Docker tricks to execute commands and transfer files.
Commands run through docker exec against the runner container. File
transfer only happens when the daemon cannot read the host filesystem;
then the files go over ssh into the data container, which shares its
volumes with the runner.
Defined Under Namespace
Classes: Connection
Instance Method Summary collapse
-
#connection(state) {|connection| ... } ⇒ Connection
A connection to the runner container.
-
#docker_for_mac_or_win? ⇒ TrueClass, FalseClass
Detect whether or not we are running in Docker for Mac or Windows.
Instance Method Details
#connection(state) {|connection| ... } ⇒ Connection
Returns a connection to the runner container.
76 77 78 79 80 81 82 83 84 |
# File 'lib/kitchen/transport/dokken.rb', line 76 def connection(state, &block) = (config.to_hash.merge(state)) if @connection && @connection_options == reuse_connection(&block) else create_new_connection(, &block) end end |
#docker_for_mac_or_win? ⇒ TrueClass, FalseClass
Detect whether or not we are running in Docker for Mac or Windows
493 494 495 496 497 498 499 500 501 |
# File 'lib/kitchen/transport/dokken.rb', line 493 def docker_for_mac_or_win? ::Docker.info(::Docker::Connection.new(config[:docker_host_url], {}))["Name"] == "docker-desktop" # `::StandardError`, spelled out. This method lives inside module # Kitchen, where a bare `StandardError` resolves to # Kitchen::StandardError -- which Excon::Error::Socket is not, so an # unreachable daemon would escape instead of answering "no". rescue ::StandardError false end |