kitchen-dokken 2.17.4 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/dokken.rb +12 -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
|
@@ -58,6 +58,7 @@ module Kitchen
|
|
58
58
|
default_config :memory_limit, 0
|
59
59
|
default_config :network_mode, "dokken"
|
60
60
|
default_config :pid_one_command, 'sh -c "trap exit 0 SIGTERM; while :; do sleep 1; done"'
|
61
|
+
default_config :platform, ""
|
61
62
|
default_config :ports, nil
|
62
63
|
default_config :privileged, false
|
63
64
|
default_config :pull_chef_image, true
|
@@ -136,9 +137,9 @@ module Kitchen
|
|
136
137
|
end
|
137
138
|
|
138
139
|
def delete_work_image
|
139
|
-
return unless ::Docker::Image.exist?(work_image, {}, docker_connection)
|
140
|
+
return unless ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
|
140
141
|
|
141
|
-
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) }
|
142
143
|
|
143
144
|
with_retries do
|
144
145
|
|
@@ -151,13 +152,14 @@ module Kitchen
|
|
151
152
|
|
152
153
|
def build_work_image(state)
|
153
154
|
info("Building work image..")
|
154
|
-
return if ::Docker::Image.exist?(work_image, {}, docker_connection)
|
155
|
+
return if ::Docker::Image.exist?(work_image, { "platform" => config[:platform] }, docker_connection)
|
155
156
|
|
156
157
|
begin
|
157
158
|
@intermediate_image = ::Docker::Image.build(
|
158
159
|
work_image_dockerfile,
|
159
160
|
{
|
160
161
|
"t" => work_image,
|
162
|
+
"platform" => config[:platform],
|
161
163
|
},
|
162
164
|
docker_connection
|
163
165
|
)
|
@@ -479,7 +481,7 @@ module Kitchen
|
|
479
481
|
end
|
480
482
|
|
481
483
|
def delete_image(name)
|
482
|
-
with_retries { @image = ::Docker::Image.get(name, {}, docker_connection) }
|
484
|
+
with_retries { @image = ::Docker::Image.get(name, { "platform" => config[:platform] }, docker_connection) }
|
483
485
|
with_retries { @image.remove(force: true) }
|
484
486
|
rescue ::Docker::Error
|
485
487
|
puts "Image #{name} not found. Nothing to delete."
|
@@ -551,6 +553,7 @@ module Kitchen
|
|
551
553
|
args["Env"] = [] if args["Env"].nil?
|
552
554
|
args["Env"] << "TEST_KITCHEN=1"
|
553
555
|
args["Env"] << "CI=#{ENV["CI"]}" if ENV.include? "CI"
|
556
|
+
args["Platform"] = config[:platform]
|
554
557
|
info "Creating container #{args["name"]}"
|
555
558
|
debug "driver - create_container args #{args}"
|
556
559
|
with_retries do
|
@@ -612,7 +615,7 @@ module Kitchen
|
|
612
615
|
end
|
613
616
|
|
614
617
|
def chef_container_name
|
615
|
-
"chef-#{chef_version}"
|
618
|
+
config[:platform] != "" ? "chef-#{chef_version}-" + config[:platform].sub("/", "-") : "chef-#{chef_version}"
|
616
619
|
end
|
617
620
|
|
618
621
|
def chef_image
|
@@ -643,7 +646,7 @@ module Kitchen
|
|
643
646
|
end
|
644
647
|
|
645
648
|
def pull_if_missing(image)
|
646
|
-
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)
|
647
650
|
|
648
651
|
pull_image image
|
649
652
|
end
|
@@ -656,11 +659,11 @@ module Kitchen
|
|
656
659
|
def pull_image(image)
|
657
660
|
path = registry_image_path(image)
|
658
661
|
with_retries do
|
659
|
-
if Docker::Image.exist?(path, {}, docker_connection)
|
660
|
-
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)
|
661
664
|
end
|
662
665
|
|
663
|
-
new_image = Docker::Image.create({ "fromImage" => path },
|
666
|
+
new_image = Docker::Image.create({ "fromImage" => path, "platform" => config[:platform] }, docker_creds, docker_connection)
|
664
667
|
|
665
668
|
!(original_image && original_image.id.start_with?(new_image.id))
|
666
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-12-
|
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.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
|