kitchen-dokken 0.0.16 → 0.0.17
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 +20 -14
- data/lib/kitchen/driver/dokken_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41ca8d4ef2829b2ad1047011468fb72489f2abad
|
4
|
+
data.tar.gz: e7c61db95324279df10e5bce107022277615bdcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d843971c8690453768bc672dfd317a601ada976cf2c7f8c423926f3d1c72f7ae3e35a998697d6298e42669637883138f21f83dc2a51d243ad3468e77bf2e8a4d
|
7
|
+
data.tar.gz: e928ecd38a6c8cdd85ada3eb2009321a604a9a188eb44d41bf7a668684613f904e35ec4c46e31b60e49556d103f41b02bc433845c83e6b123a84e88de4eaf0bb
|
@@ -239,18 +239,6 @@ module Kitchen
|
|
239
239
|
puts "Image #{name} not found. Nothing to delete."
|
240
240
|
end
|
241
241
|
|
242
|
-
def delete_container(name)
|
243
|
-
with_retries { @container = Docker::Container.get(name, docker_connection) }
|
244
|
-
puts "Destroying container #{name}."
|
245
|
-
with_retries do
|
246
|
-
@container.stop(force: true)
|
247
|
-
wait_running_state(args['name'], false)
|
248
|
-
end
|
249
|
-
with_retries { @container.delete(force: true, v: true) }
|
250
|
-
rescue
|
251
|
-
puts "Container #{name} not found. Nothing to delete."
|
252
|
-
end
|
253
|
-
|
254
242
|
def container_exist?(name)
|
255
243
|
return true if Docker::Container.get(name)
|
256
244
|
rescue
|
@@ -284,15 +272,33 @@ module Kitchen
|
|
284
272
|
@container ? @container.info['State'] : {}
|
285
273
|
end
|
286
274
|
|
275
|
+
def delete_container(name)
|
276
|
+
with_retries { @container = Docker::Container.get(name, docker_connection) }
|
277
|
+
puts "Destroying container #{name}."
|
278
|
+
|
279
|
+
begin
|
280
|
+
with_retries { @container.delete(force: true, v: true) }
|
281
|
+
rescue
|
282
|
+
puts "Container #{name} not found. Nothing to stop."
|
283
|
+
end
|
284
|
+
|
285
|
+
begin
|
286
|
+
with_retries do
|
287
|
+
@container.stop(force: true)
|
288
|
+
wait_running_state(args['name'], false)
|
289
|
+
end
|
290
|
+
rescue
|
291
|
+
puts "Container #{name} not found. Nothing to delete."
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
287
295
|
def wait_running_state(name, v)
|
288
296
|
@container = Docker::Container.get(name)
|
289
|
-
# require 'pry' ; binding.pry
|
290
297
|
i = 0
|
291
298
|
tries = 20
|
292
299
|
until container_state['Running'] == v || container_state['FinishedAt'] != '0001-01-01T00:00:00Z'
|
293
300
|
i += 1
|
294
301
|
break if i == tries
|
295
|
-
puts "SEANDEBUG: #{container_state['Running']}"
|
296
302
|
sleep 0.1
|
297
303
|
@container = Docker::Container.get(name)
|
298
304
|
end
|