kitchen-dokken 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d476d98405ea2e16c01d8b5222a404e8ce344c9
4
- data.tar.gz: aa8acd58b318db0bb60bad95f9790ff37906d9fe
3
+ metadata.gz: 624899b08f3767c8e67ee162a4d80aa5eced1e3d
4
+ data.tar.gz: 186e7dcd5682fceefe9c29c2379623f992827eb3
5
5
  SHA512:
6
- metadata.gz: be1714202042a22e154b96ad464ae026d0c14af254da5b68de13b9f27c55c039305563e80e3279fcf78338f5a74ec22cc86c0caa5f51359ab7287a60a4e20628
7
- data.tar.gz: f94fc078e067c9ffceee7c058209563430f683c5565fecaf4c367fc3089415a5c1c0ee8c47a500fad425b26206867971522d3deabe24f13f3369cf7e05735b9b
6
+ metadata.gz: 6da44eaba2464e9d3f904dc8deef11ef956c885d99f1aa77bfea41bdfef790621da86f27f0c934effb0d06e92f410dc4b55683699b35bf998f082648da1d5521
7
+ data.tar.gz: cc554c47b56339cad2796e204408ae9c50631246c4a29ed9b310512e5a75bf959f1519c3c76eb9db85ca8885541e302cb64aa2398603da051eddf8fbb5706129
@@ -32,7 +32,6 @@ module Kitchen
32
32
  # @author Sean OMeara <sean@chef.io>
33
33
  class Dokken < Kitchen::Driver::Base
34
34
  default_config :pid_one_command, 'sh -c "trap exit 0 SIGTERM; while :; do sleep 1; done"'
35
- default_config :privileged, false
36
35
  default_config :image_prefix, nil
37
36
  default_config :chef_version, '12.5.1'
38
37
  default_config :data_image, 'someara/kitchen-cache:latest'
@@ -40,6 +39,15 @@ module Kitchen
40
39
  default_config :read_timeout, 3600
41
40
  default_config :write_timeout, 3600
42
41
  default_config :api_retries, 20
42
+ # docker run args
43
+ default_config :privileged, false
44
+ default_config :hostname, nil
45
+ default_config :binds, nil # volumes to mount
46
+ default_config :links, nil
47
+ default_config :cap_add, nil
48
+ default_config :cap_drop, nil
49
+ default_config :security_opt, nil
50
+ default_config :network_mode, 'bridge'
43
51
 
44
52
  # (see Base#create)
45
53
  def create(state)
@@ -185,9 +193,16 @@ module Kitchen
185
193
  'name' => runner_container_name,
186
194
  'Cmd' => Shellwords.shellwords(config[:pid_one_command]),
187
195
  'Image' => "#{repo(work_image)}:#{tag(work_image)}",
196
+ 'Hostname' => config[:hostname],
188
197
  'HostConfig' => {
189
198
  'Privileged' => config[:privileged],
190
- 'VolumesFrom' => [chef_container_name, data_container_name]
199
+ 'VolumesFrom' => [chef_container_name, data_container_name],
200
+ 'Binds' => Array(config[:binds]),
201
+ 'Links' => Array(config[:links]),
202
+ 'CapAdd' => Array(config[:cap_add]),
203
+ 'CapDrop' => Array(config[:cap_drop]),
204
+ 'SecurityOpt' => Array(config[:security_opt]),
205
+ 'NetworkMode' => config[:network_mode],
191
206
  }
192
207
  )
193
208
  state[:runner_container] = runner_container.json
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Dokken Kitchen driver
22
- DOKKEN_VERSION = '0.0.31'
22
+ DOKKEN_VERSION = '0.0.32'
23
23
  end
24
24
  end
@@ -41,6 +41,7 @@ module Kitchen
41
41
  default_config :docker_host_url, ENV['DOCKER_HOST'] || 'unix:///var/run/docker.sock'
42
42
  default_config :read_timeout, 3600
43
43
  default_config :write_timeout, 3600
44
+ default_config :host_ip_override, false
44
45
 
45
46
  # (see Base#connection)
46
47
  def connection(state, &block)
@@ -83,7 +84,10 @@ module Kitchen
83
84
  end
84
85
 
85
86
  def upload(locals, remote)
86
- if options[:docker_host_url] =~ /unix:/
87
+ if options[:host_ip_override]
88
+ # Allow connecting to any ip/hostname to support sibling containers
89
+ ip = options[:host_ip_override]
90
+ elsif options[:docker_host_url] =~ /unix:/
87
91
  # we should read the proper mapped ip, since this allows us to upload the files
88
92
  ip = options[:data_container][:NetworkSettings][:Ports][:"22/tcp"][0][:HostIp]
89
93
  elsif options[:docker_host_url] =~ /tcp:/
@@ -162,6 +166,7 @@ module Kitchen
162
166
  # @api private
163
167
  def connection_options(data) # rubocop:disable Metrics/MethodLength
164
168
  opts = {}
169
+ opts[:host_ip_override] = config[:host_ip_override]
165
170
  opts[:docker_host_url] = config[:docker_host_url]
166
171
  opts[:docker_host_options] = ::Docker.options
167
172
  opts[:data_container] = data[:data_container]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dokken
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-24 00:00:00.000000000 Z
11
+ date: 2016-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.6.4
76
+ rubygems_version: 2.6.6
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: A Test Kitchen Driver that talks to the Docker Remote API and uses Volumes