kitchen-dokken 2.15.0 → 2.17.1

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: d549607487cae2cf1d58c9fadfed6e5c0649d085b27dc0841abf32d4a23670df
4
- data.tar.gz: 4be3556b19ae6795d6c70d196913ed79f7d14971dc386f539a0321683ecdf49b
3
+ metadata.gz: 439fb37e48ca255580cdd6030a23c4c1b4e7934f068673dab400580f74220a36
4
+ data.tar.gz: 30bf493770664d64183dda32f620e28c8ce52a101c9a0dff102722bfb9e22f1c
5
5
  SHA512:
6
- metadata.gz: ee6f97ad4f722b828f9d0508a69224ef7ae4514b39280a3c84ae14351626939e04d7fdae779c4280efcc4d88210a37fad02dab74ad638432d8aa1e929e40e1e7
7
- data.tar.gz: 5035e7f732b10ed7f9407555d612441c509985acd6d33d577d23c02c0529cd80be0f93c2c668fc0355135ed765e9844d075adfaf417de441a501858588042e2a
6
+ metadata.gz: 167d8f6dcee24404a402a7e7949f80acbb8cf6e1ee12cdfe523913dadf5ef17f384b88a49670c8012e471ea2599b8095e13485423cfe67c55d9261cb0fe7191c
7
+ data.tar.gz: ea8a6a0462740bab02bdcd0ef0ab2bf2810a3f097523c5f6cb824e8b25cf31a023aefbb3b3fda796b68fa4ea560b3b92281a0f178f882047c86e39b1aad6e8c0
@@ -66,9 +66,13 @@ module Kitchen
66
66
  default_config :userns_host, false
67
67
  default_config :volumes, nil
68
68
  default_config :write_timeout, 3600
69
+ default_config :creds_file, nil
69
70
 
70
71
  # (see Base#create)
71
72
  def create(state)
73
+ # Authenticate the private registry
74
+ authenticate!
75
+
72
76
  # image to config
73
77
  pull_platform_image
74
78
 
@@ -410,6 +414,21 @@ module Kitchen
410
414
  end
411
415
  end
412
416
 
417
+ def authenticate!
418
+ # No need to authenticate if the credentials are empty
419
+ return if docker_creds.empty?
420
+
421
+ ::Docker.authenticate! docker_creds
422
+ end
423
+
424
+ def docker_creds
425
+ @docker_creds ||= if config[:creds_file]
426
+ JSON.parse(IO.read(config[:creds_file]))
427
+ else
428
+ {}
429
+ end
430
+ end
431
+
413
432
  def pull_platform_image
414
433
  debug "driver - pulling #{short_image_path(platform_image)}"
415
434
  config[:pull_platform_image] ? pull_image(platform_image) : pull_if_missing(platform_image)
@@ -602,7 +621,7 @@ module Kitchen
602
621
  original_image = Docker::Image.get(path, {}, docker_connection)
603
622
  end
604
623
 
605
- new_image = Docker::Image.create({ "fromImage" => path }, {}, docker_connection)
624
+ new_image = Docker::Image.create({ "fromImage" => path }, docker_creds, docker_connection)
606
625
 
607
626
  !(original_image && original_image.id.start_with?(new_image.id))
608
627
  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.15.0".freeze
21
+ DOKKEN_VERSION = "2.17.1".freeze
22
22
  end
23
23
  end
@@ -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.15.0
4
+ version: 2.17.1
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-10-22 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -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.2.22
100
+ rubygems_version: 3.2.3
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: A Test Kitchen Driver for Docker & Chef Infra optimized for rapid testing