kitchen-dokken 2.21.0 → 2.21.1

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
  SHA256:
3
- metadata.gz: 75320b721c7b0d35bd1d5405cebf349e5e088011dc1ee3c3aaf8576f3a9f261a
4
- data.tar.gz: da4956467f5139937cd40b06bfaeb0410f865a70f16b81bb562b05affc7568ab
3
+ metadata.gz: 7fdf8e2760518e4111926d61f98208aff49627aa8c2b0b59db6c407686e9fc76
4
+ data.tar.gz: 1580df76853f7a62551f3c66b3e01d575c71c64efeffef092d66c2455c0c9df5
5
5
  SHA512:
6
- metadata.gz: 608b0a623e7ee0033478972368e7df9fdd28989b3a3aa60ab675891960fef5b6ca9468532c9984108bd3de9b23a64264ed968875ba64e82c8de762bbeb265271
7
- data.tar.gz: 1851fe00d79ae0ae134d91aecd3569a4f910e2cb19c0e8dec7883949f969fb895307ed242a44fd972f1365744fd9203bd8be1fdb2f0a1fcc03deef1a346f3a0e
6
+ metadata.gz: eb5c56ae989af89f74abc40767939a74579959192f0cd840a8b96efad5ea4006fbaa5d39a3c426a1073bd0e4be58f83d1046deb0afcf3d2019d773a65f3175ff
7
+ data.tar.gz: b6506bd5e7d5728e0c8d3e4a7690475b49d517294ab0d3559f22b390ac4eb5a1f83fa37a53710c5ea2682c601af749ea4cbaa148331cfd2a7d6f997134a4bdb5
@@ -45,7 +45,9 @@ module Kitchen
45
45
  default_config :dns, nil
46
46
  default_config :dns_search, nil
47
47
  default_config :docker_host_url, default_docker_host
48
- default_config :docker_info, docker_info
48
+ default_config :docker_info do |driver|
49
+ docker_info(driver[:docker_host_url])
50
+ end
49
51
  default_config :docker_registry, nil
50
52
  default_config :entrypoint, nil
51
53
  default_config :env, nil
@@ -138,9 +140,9 @@ module Kitchen
138
140
  end
139
141
 
140
142
  def delete_work_image
141
- return unless ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
143
+ return unless ::Docker::Image.exist?(work_image, { "platform" => oci_platform(config[:platform]) }, docker_connection)
142
144
 
143
- with_retries { @work_image = ::Docker::Image.get(work_image, { "platform" => config[:platform] }, docker_connection) }
145
+ with_retries { @work_image = ::Docker::Image.get(work_image, { "platform" => oci_platform(config[:platform]) }, docker_connection) }
144
146
 
145
147
  with_retries do
146
148
  with_retries { @work_image.remove(force: true) }
@@ -151,7 +153,7 @@ module Kitchen
151
153
 
152
154
  def build_work_image(state)
153
155
  info("Building work image..")
154
- return if ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
156
+ return if ::Docker::Image.exist?(work_image, { "platform" => oci_platform(config[:platform]) }, docker_connection)
155
157
 
156
158
  begin
157
159
  @intermediate_image = ::Docker::Image.build(
@@ -511,7 +513,7 @@ module Kitchen
511
513
  end
512
514
 
513
515
  def delete_image(name)
514
- with_retries { @image = ::Docker::Image.get(name, { "platform" => config[:platform] }, docker_connection) }
516
+ with_retries { @image = ::Docker::Image.get(name, { "platform" => oci_platform(config[:platform]) }, docker_connection) }
515
517
  with_retries { @image.remove(force: true) }
516
518
  rescue ::Docker::Error
517
519
  puts "Image #{name} not found. Nothing to delete."
@@ -674,7 +676,7 @@ module Kitchen
674
676
  end
675
677
 
676
678
  def pull_if_missing(image)
677
- return if ::Docker::Image.exist?(registry_image_path(image), { "platform" => config[:platform] }, docker_connection)
679
+ return if ::Docker::Image.exist?(registry_image_path(image), { "platform" => oci_platform(config[:platform]) }, docker_connection)
678
680
 
679
681
  pull_image image
680
682
  end
@@ -687,8 +689,8 @@ module Kitchen
687
689
  def pull_image(image)
688
690
  path = registry_image_path(image)
689
691
  with_retries do
690
- if Docker::Image.exist?(path, { "platform" => config[:platform] }, docker_connection)
691
- original_image = Docker::Image.get(path, { "platform" => config[:platform] }, docker_connection)
692
+ if Docker::Image.exist?(path, { "platform" => oci_platform(config[:platform]) }, docker_connection)
693
+ original_image = Docker::Image.get(path, { "platform" => oci_platform(config[:platform]) }, docker_connection)
692
694
  end
693
695
 
694
696
  new_image = Docker::Image.create({ "fromImage" => path, "platform" => config[:platform] }, docker_creds_for_image(image), docker_connection)
@@ -697,6 +699,14 @@ module Kitchen
697
699
  end
698
700
  end
699
701
 
702
+ def oci_platform(platform)
703
+ if !platform.nil? && platform.include?("/")
704
+ os, arch = platform.split("/")
705
+ platform = { os: os, architecture: arch }.to_json
706
+ end
707
+ platform
708
+ end
709
+
700
710
  def runner_container_name
701
711
  instance_name.to_s
702
712
  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.21.0".freeze
21
+ DOKKEN_VERSION = "2.21.1".freeze
22
22
  end
23
23
  end
@@ -81,7 +81,7 @@ module Dokken
81
81
  RUN chmod 600 /root/.ssh/authorized_keys
82
82
 
83
83
  EXPOSE 22
84
- CMD [ "/usr/sbin/sshd", "-D", "-p", "22", "-o", "UseDNS=no", "-o", "UsePrivilegeSeparation=no", "-o", "MaxAuthTries=60" ]
84
+ CMD [ "/usr/sbin/sshd", "-D", "-p", "22", "-o", "UseDNS=no", "-o", "MaxAuthTries=60" ]
85
85
 
86
86
  VOLUME #{resolved_root_path}
87
87
  VOLUME /opt/verifier
@@ -117,8 +117,8 @@ module Dokken
117
117
  end
118
118
  end
119
119
 
120
- def docker_info
121
- ::Docker.url = default_docker_host
120
+ def docker_info(docker_host)
121
+ ::Docker.url = docker_host
122
122
 
123
123
  @docker_info ||= ::Docker.info
124
124
  rescue Excon::Error::Socket
@@ -35,7 +35,9 @@ module Kitchen
35
35
  default_config :chef_log_level, "warn"
36
36
  default_config :chef_output_format, "doc"
37
37
  default_config :profile_ruby, false
38
- default_config :docker_info, docker_info
38
+ default_config :docker_info do |provisioner|
39
+ docker_info(provisioner[:docker_host_url])
40
+ end
39
41
  default_config :docker_host_url, default_docker_host
40
42
 
41
43
  # Dokken is weird - the provisioner inherits from ChefZero but does not install
@@ -39,7 +39,9 @@ module Kitchen
39
39
 
40
40
  plugin_version Kitchen::VERSION
41
41
 
42
- default_config :docker_info, docker_info
42
+ default_config :docker_info do |transport|
43
+ docker_info(transport[:docker_host_url])
44
+ end
43
45
  default_config :docker_host_url, default_docker_host
44
46
  default_config :read_timeout, 3600
45
47
  default_config :write_timeout, 3600
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.21.0
4
+ version: 2.21.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: 2025-08-16 00:00:00.000000000 Z
11
+ date: 2025-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api