kitchen-dokken 2.17.3 → 2.18.0
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 +4 -4
- data/lib/kitchen/driver/dokken.rb +16 -9
- data/lib/kitchen/driver/dokken_version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f73c03e77f7fab51c83c62e31ea41343a58620e8246d6c174a877c752503e1e8
|
|
4
|
+
data.tar.gz: 2ad555af59f56455551c9927654d400dab573c2c71be7292d4919b5527f46bf4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62edea017014a519f4b103bd6bd0572459ab780fc4e6bb544eda21677448ccd07933965499aafbe1d56708b7bff4b50c4b2f29c4ed8cb1f2f365fe01f6fb5468
|
|
7
|
+
data.tar.gz: fc6c78ecf7227b64354fa9afe7d1706c4082799efc3dfe5a3af604078e41a50316cf094296101e0bf280165705caae15146f232ed601c98b8f8b4337a0b68898
|
|
@@ -38,6 +38,7 @@ module Kitchen
|
|
|
38
38
|
default_config :binds, []
|
|
39
39
|
default_config :cap_add, nil
|
|
40
40
|
default_config :cap_drop, nil
|
|
41
|
+
default_config :cgroupns_host, false
|
|
41
42
|
default_config :chef_image, "chef/chef"
|
|
42
43
|
default_config :chef_version, "latest"
|
|
43
44
|
default_config :data_image, "dokken/kitchen-cache:latest"
|
|
@@ -57,6 +58,7 @@ module Kitchen
|
|
|
57
58
|
default_config :memory_limit, 0
|
|
58
59
|
default_config :network_mode, "dokken"
|
|
59
60
|
default_config :pid_one_command, 'sh -c "trap exit 0 SIGTERM; while :; do sleep 1; done"'
|
|
61
|
+
default_config :platform, ""
|
|
60
62
|
default_config :ports, nil
|
|
61
63
|
default_config :privileged, false
|
|
62
64
|
default_config :pull_chef_image, true
|
|
@@ -135,9 +137,9 @@ module Kitchen
|
|
|
135
137
|
end
|
|
136
138
|
|
|
137
139
|
def delete_work_image
|
|
138
|
-
return unless ::Docker::Image.exist?(work_image, {}, docker_connection)
|
|
140
|
+
return unless ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
|
|
139
141
|
|
|
140
|
-
with_retries { @work_image = ::Docker::Image.get(work_image, {}, docker_connection) }
|
|
142
|
+
with_retries { @work_image = ::Docker::Image.get(work_image, { "platform" => config[:platform] }, docker_connection) }
|
|
141
143
|
|
|
142
144
|
with_retries do
|
|
143
145
|
|
|
@@ -150,13 +152,14 @@ module Kitchen
|
|
|
150
152
|
|
|
151
153
|
def build_work_image(state)
|
|
152
154
|
info("Building work image..")
|
|
153
|
-
return if ::Docker::Image.exist?(work_image, {}, docker_connection)
|
|
155
|
+
return if ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
|
|
154
156
|
|
|
155
157
|
begin
|
|
156
158
|
@intermediate_image = ::Docker::Image.build(
|
|
157
159
|
work_image_dockerfile,
|
|
158
160
|
{
|
|
159
161
|
"t" => work_image,
|
|
162
|
+
"platform" => config[:platform],
|
|
160
163
|
},
|
|
161
164
|
docker_connection
|
|
162
165
|
)
|
|
@@ -330,6 +333,9 @@ module Kitchen
|
|
|
330
333
|
unless self[:entrypoint].to_s.empty?
|
|
331
334
|
config["Entrypoint"] = self[:entrypoint]
|
|
332
335
|
end
|
|
336
|
+
if self[:cgroupns_host]
|
|
337
|
+
config["HostConfig"]["CgroupnsMode"] = "host"
|
|
338
|
+
end
|
|
333
339
|
if self[:userns_host]
|
|
334
340
|
config["HostConfig"]["UsernsMode"] = "host"
|
|
335
341
|
end
|
|
@@ -475,7 +481,7 @@ module Kitchen
|
|
|
475
481
|
end
|
|
476
482
|
|
|
477
483
|
def delete_image(name)
|
|
478
|
-
with_retries { @image = ::Docker::Image.get(name, {}, docker_connection) }
|
|
484
|
+
with_retries { @image = ::Docker::Image.get(name, { "platform" => config[:platform] }, docker_connection) }
|
|
479
485
|
with_retries { @image.remove(force: true) }
|
|
480
486
|
rescue ::Docker::Error
|
|
481
487
|
puts "Image #{name} not found. Nothing to delete."
|
|
@@ -547,6 +553,7 @@ module Kitchen
|
|
|
547
553
|
args["Env"] = [] if args["Env"].nil?
|
|
548
554
|
args["Env"] << "TEST_KITCHEN=1"
|
|
549
555
|
args["Env"] << "CI=#{ENV["CI"]}" if ENV.include? "CI"
|
|
556
|
+
args["Platform"] = config[:platform]
|
|
550
557
|
info "Creating container #{args["name"]}"
|
|
551
558
|
debug "driver - create_container args #{args}"
|
|
552
559
|
with_retries do
|
|
@@ -608,7 +615,7 @@ module Kitchen
|
|
|
608
615
|
end
|
|
609
616
|
|
|
610
617
|
def chef_container_name
|
|
611
|
-
"chef-#{chef_version}"
|
|
618
|
+
config[:platform] != "" ? "chef-#{chef_version}-" + config[:platform].sub("/", "-") : "chef-#{chef_version}"
|
|
612
619
|
end
|
|
613
620
|
|
|
614
621
|
def chef_image
|
|
@@ -639,7 +646,7 @@ module Kitchen
|
|
|
639
646
|
end
|
|
640
647
|
|
|
641
648
|
def pull_if_missing(image)
|
|
642
|
-
return if ::Docker::Image.exist?(registry_image_path(image), {}, docker_connection)
|
|
649
|
+
return if ::Docker::Image.exist?(registry_image_path(image), { "platform" => config[:platform] }, docker_connection)
|
|
643
650
|
|
|
644
651
|
pull_image image
|
|
645
652
|
end
|
|
@@ -652,11 +659,11 @@ module Kitchen
|
|
|
652
659
|
def pull_image(image)
|
|
653
660
|
path = registry_image_path(image)
|
|
654
661
|
with_retries do
|
|
655
|
-
if Docker::Image.exist?(path, {}, docker_connection)
|
|
656
|
-
original_image = Docker::Image.get(path, {}, docker_connection)
|
|
662
|
+
if Docker::Image.exist?(path, { "platform" => config[:platform] }, docker_connection)
|
|
663
|
+
original_image = Docker::Image.get(path, { "platform" => config[:platform] }, docker_connection)
|
|
657
664
|
end
|
|
658
665
|
|
|
659
|
-
new_image = Docker::Image.create({ "fromImage" => path },
|
|
666
|
+
new_image = Docker::Image.create({ "fromImage" => path, "platform" => config[:platform] }, docker_creds, docker_connection)
|
|
660
667
|
|
|
661
668
|
!(original_image && original_image.id.start_with?(new_image.id))
|
|
662
669
|
end
|
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.
|
|
4
|
+
version: 2.18.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: 2022-
|
|
11
|
+
date: 2022-12-22 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.
|
|
100
|
+
rubygems_version: 3.3.16
|
|
101
101
|
signing_key:
|
|
102
102
|
specification_version: 4
|
|
103
103
|
summary: A Test Kitchen Driver for Docker & Chef Infra optimized for rapid testing
|