kitchen-dokken 2.12.1 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 517d0d0706aed8e8fc5889c874d6817fe65cfa571ba3a7a082d8256f707986cd
4
- data.tar.gz: f5beb66dc47d9c4f58022c26af3ce8657c7fae40443eb2d3ee1b5ef2c01f5d0e
3
+ metadata.gz: 8c1eb7ea3b8b7026368f17e936583541737f204457ac3717a1d30107635330f9
4
+ data.tar.gz: 2606b5d2255543272111230715c7b6a050e3e58b7957d6335265d884059e52db
5
5
  SHA512:
6
- metadata.gz: fd3d097a36e249e21f88ea3a1999207f9e45e464a9eb649d10c870d24d4a0705766dfb57df3ced2c82cda4e6cee04d5b53587b36743dbdd887da036d00c5d7c8
7
- data.tar.gz: 755b9671c1aa2cbf14a90ddb9c730e3d50d5326a6244f2d8ece875b5bf5b5e9567c3c5f9661cd6cb6a00e6e4ec0594efcd5aa2fe0daf56e0fca7bf78c6a76d61
6
+ metadata.gz: 5c91016a21ae59923337c4e91fb61ef3920918da3340b24427392b325a812d016727c98482409eaeee9c825074a3b5559e669c4bc4ac5e67bd5bf5b6fdf43347
7
+ data.tar.gz: 388e6ba61fc2c4d2ba88e28780e4b541dc7dffe426f4250d7a6a99b52bbb1c0c98f6c9ae6bc306bdd640273b41f2852e83a851556d5a226aa1912bc4a04f02ff
@@ -48,7 +48,10 @@ module Kitchen
48
48
  default_config :entrypoint, nil
49
49
  default_config :env, nil
50
50
  default_config :hostname, "dokken"
51
+ default_config :hostname_aliases, nil
51
52
  default_config :image_prefix, nil
53
+ default_config :ipv6, false
54
+ default_config :ipv6_subnet, "2001:db8:1::/64" # "2001:db8::/32 Range reserved for documentation"
52
55
  default_config :links, nil
53
56
  default_config :memory_limit, 0
54
57
  default_config :network_mode, "dokken"
@@ -313,7 +316,7 @@ module Kitchen
313
316
  "NetworkingConfig" => {
314
317
  "EndpointsConfig" => {
315
318
  self[:network_mode] => {
316
- "Aliases" => Array(self[:hostname]),
319
+ "Aliases" => Array(self[:hostname]).concat(Array(self[:hostname_aliases])),
317
320
  },
318
321
  },
319
322
  },
@@ -358,7 +361,7 @@ module Kitchen
358
361
  with_retries { ::Docker::Network.get("dokken", {}, docker_connection) }
359
362
  rescue ::Docker::Error::NotFoundError
360
363
  begin
361
- with_retries { ::Docker::Network.create("dokken", {}) }
364
+ with_retries { ::Docker::Network.create("dokken", network_settings) }
362
365
  rescue ::Docker::Error => e
363
366
  debug "driver - error :#{e}:"
364
367
  end
@@ -599,7 +602,7 @@ module Kitchen
599
602
  original_image = Docker::Image.get(path, {}, docker_connection)
600
603
  end
601
604
 
602
- new_image = Docker::Image.create({ "fromImage" => path }, docker_connection)
605
+ new_image = Docker::Image.create({ "fromImage" => path }, {}, docker_connection)
603
606
 
604
607
  !(original_image && original_image.id.start_with?(new_image.id))
605
608
  end
@@ -18,6 +18,6 @@
18
18
  module Kitchen
19
19
  module Driver
20
20
  # Version string for Dokken Kitchen driver
21
- DOKKEN_VERSION = "2.12.1".freeze
21
+ DOKKEN_VERSION = "2.16.0".freeze
22
22
  end
23
23
  end
@@ -117,6 +117,8 @@ VOLUME /opt/verifier
117
117
  end
118
118
 
119
119
  def docker_info
120
+ ::Docker.url = default_docker_host
121
+
120
122
  @docker_info ||= ::Docker.info
121
123
  rescue Excon::Error::Socket
122
124
  puts "kitchen-dokken could not connect to the docker host at #{default_docker_host}. Is docker running?"
@@ -175,6 +177,21 @@ VOLUME /opt/verifier
175
177
  coerce_exposed_ports(config[:ports])
176
178
  end
177
179
 
180
+ def network_settings
181
+ if self[:ipv6]
182
+ {
183
+ "EnableIPv6" => true,
184
+ "IPAM" => {
185
+ "Config" => [{
186
+ "Subnet" => self[:ipv6_subnet],
187
+ }],
188
+ },
189
+ }
190
+ else
191
+ {}
192
+ end
193
+ end
194
+
178
195
  def port_bindings
179
196
  coerce_port_bindings(config[:ports])
180
197
  end
@@ -244,6 +261,7 @@ VOLUME /opt/verifier
244
261
  end
245
262
 
246
263
  def remote_docker_host?
264
+ return false if config[:docker_info]["OperatingSystem"].include?("Docker Desktop")
247
265
  return false if config[:docker_info]["OperatingSystem"].include?("Boot2Docker")
248
266
  return true if /^tcp:/.match?(config[:docker_host_url])
249
267
 
@@ -109,12 +109,13 @@ module Kitchen
109
109
  cmd << " -c /opt/kitchen/client.rb"
110
110
  cmd << " -j /opt/kitchen/dna.json"
111
111
  cmd << "--profile-ruby" if config[:profile_ruby]
112
+ cmd << "--slow-report" if config[:slow_resource_report]
112
113
 
113
114
  chef_cmd(cmd)
114
115
  end
115
116
 
116
117
  def write_run_command(command)
117
- File.write("#{dokken_kitchen_sandbox}/run_command", command)
118
+ File.write("#{dokken_kitchen_sandbox}/run_command", command, mode: "wb")
118
119
  end
119
120
 
120
121
  def runner_container_name
@@ -69,7 +69,9 @@ module Kitchen
69
69
 
70
70
  with_retries { @runner = ::Docker::Container.get(instance_name, {}, docker_connection) }
71
71
  with_retries do
72
- o = @runner.exec(Shellwords.shellwords(command), wait: options[:timeout], "e" => { "TERM" => "xterm" }) { |_stream, chunk| print chunk.to_s }
72
+ o = @runner.exec(Shellwords.shellwords(command), wait: options[:timeout], "e" => { "TERM" => "xterm" }) do |_stream, chunk|
73
+ logger << chunk
74
+ end
73
75
  @exit_code = o[2]
74
76
  end
75
77
 
@@ -224,6 +226,7 @@ module Kitchen
224
226
  # @api private
225
227
  def connection_options(data)
226
228
  opts = {}
229
+ opts[:logger] = logger
227
230
  opts[:host_ip_override] = config[:host_ip_override]
228
231
  opts[:docker_host_url] = config[:docker_host_url]
229
232
  opts[:docker_host_options] = ::Docker.options
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: 2.12.1
4
+ version: 2.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -53,7 +53,7 @@ dependencies:
53
53
  version: '1.15'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '3'
56
+ version: '4'
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +63,7 @@ dependencies:
63
63
  version: '1.15'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: '3'
66
+ version: '4'
67
67
  description: A Test Kitchen Driver for Docker & Chef Infra optimized for rapid testing
68
68
  using Chef Infra docker images
69
69
  email:
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.1.4
100
+ rubygems_version: 3.2.22
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: A Test Kitchen Driver for Docker & Chef Infra optimized for rapid testing