centurion 1.8.8 → 1.8.9

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
  SHA1:
3
- metadata.gz: 5d6a3ace96ff33ba0c059c1c0147e33f20120569
4
- data.tar.gz: ae5f4c1b8f87f86ccdf0a2535772c27f3511677e
3
+ metadata.gz: e8966e2e693a5e6dd465d8c656622937e5844aca
4
+ data.tar.gz: b7d314a3c53734bf240f1662c91ce8a69044faf0
5
5
  SHA512:
6
- metadata.gz: 9d3e9aedb002d7d000fecd8ba45a8ade798752f3da06c1cfe3522caf1ab7c891ee33e83686470e90878d8b24ec83a612fc313b233b0622dcfadacfddcc7a08b6
7
- data.tar.gz: 6eaa259d3cd1b9a5ad45e12bc2991905e870085dc09d66649ba8e5d4a7dca8ee5526da721c2978b10dcccbc450dc8a1fe0786e503656dad747b7c96e3e793873
6
+ metadata.gz: d3b49c8b73ef7206922b8ccb700a14a43d53fa2a3b0a7f3d8706fc59a22041bbcbdad44d7af83a9fdf6372743ea558fdc919404d5d1f6ac94e08beae22bd2c6c
7
+ data.tar.gz: 9972af6f0db91ea3ecfb9eb977090822109fd78faf285d48d2d64b680f0edf757f97e004bd38c12048a2d13cf554fac83f88e1d379c55199d874e2e9f5fcba52
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'logger-colors'
39
39
 
40
40
  spec.add_development_dependency 'bundler'
41
- spec.add_development_dependency 'rake'
41
+ spec.add_development_dependency 'rake', '~> 10.5'
42
42
  spec.add_development_dependency 'rspec', '~> 3.1.0'
43
43
  spec.add_development_dependency 'pry'
44
44
  spec.add_development_dependency 'simplecov'
@@ -50,7 +50,9 @@ class Centurion::DockerViaApi
50
50
  response = Excon.post(
51
51
  @base_uri + path,
52
52
  tls_excon_arguments.merge(
53
- read_timeout: timeout
53
+ # Wait for both the docker stop timeout AND the kill AND
54
+ # potentially a very slow HTTP server.
55
+ read_timeout: timeout + 120
54
56
  )
55
57
  )
56
58
  raise response.inspect unless response.status == 204
@@ -94,7 +96,11 @@ class Centurion::DockerViaApi
94
96
  path = @docker_api_version + "/containers/#{container_id}/restart?t=#{timeout}"
95
97
  response = Excon.post(
96
98
  @base_uri + path,
97
- tls_excon_arguments
99
+ tls_excon_arguments.merge(
100
+ # Wait for both the docker stop timeout AND the kill AND
101
+ # potentially a very slow HTTP server.
102
+ read_timeout: timeout + 120
103
+ )
98
104
  )
99
105
  case response.status
100
106
  when 204
@@ -1,3 +1,3 @@
1
1
  module Centurion
2
- VERSION = '1.8.8'
2
+ VERSION = '1.8.9'
3
3
  end
@@ -63,28 +63,29 @@ describe Centurion::DockerViaApi do
63
63
 
64
64
  it 'stops a container' do
65
65
  expect(Excon).to receive(:post).
66
- with(excon_uri + "v1.12" + "/containers/12345/stop?t=300", {read_timeout: 300}).
66
+ with(excon_uri + "v1.12" + "/containers/12345/stop?t=300", {read_timeout: 420}).
67
67
  and_return(double(status: 204))
68
68
  api.stop_container('12345', 300)
69
69
  end
70
70
 
71
71
  it 'stops a container with a custom timeout' do
72
72
  expect(Excon).to receive(:post).
73
- with(excon_uri + "v1.12" + "/containers/12345/stop?t=30", {read_timeout: 30}).
73
+ with(excon_uri + "v1.12" + "/containers/12345/stop?t=30", {read_timeout: 150}).
74
74
  and_return(double(status: 204))
75
75
  api.stop_container('12345')
76
76
  end
77
77
 
78
78
  it 'restarts a container' do
79
79
  expect(Excon).to receive(:post).
80
- with(excon_uri + "v1.12" + "/containers/12345/restart?t=30", {}).
80
+ with(excon_uri + "v1.12" + "/containers/12345/restart?t=30",
81
+ {read_timeout: 150}).
81
82
  and_return(double(body: json_string, status: 204))
82
83
  api.restart_container('12345')
83
84
  end
84
85
 
85
86
  it 'restarts a container with a custom timeout' do
86
87
  expect(Excon).to receive(:post).
87
- with(excon_uri + "v1.12" + "/containers/12345/restart?t=300", {}).
88
+ with(excon_uri + "v1.12" + "/containers/12345/restart?t=300", {:read_timeout=>420}).
88
89
  and_return(double(body: json_string, status: 204))
89
90
  api.restart_container('12345', 300)
90
91
  end
@@ -179,7 +180,7 @@ describe Centurion::DockerViaApi do
179
180
  with(excon_uri + "v1.12" + "/containers/12345/stop?t=300",
180
181
  client_cert: '/certs/cert.pem',
181
182
  client_key: '/certs/key.pem',
182
- read_timeout: 300).
183
+ read_timeout: 420).
183
184
  and_return(double(status: 204))
184
185
  api.stop_container('12345', 300)
185
186
  end
@@ -189,7 +190,7 @@ describe Centurion::DockerViaApi do
189
190
  with(excon_uri + "v1.12" + "/containers/12345/stop?t=30",
190
191
  client_cert: '/certs/cert.pem',
191
192
  client_key: '/certs/key.pem',
192
- read_timeout: 30).
193
+ read_timeout: 150).
193
194
  and_return(double(status: 204))
194
195
  api.stop_container('12345')
195
196
  end
@@ -198,7 +199,8 @@ describe Centurion::DockerViaApi do
198
199
  expect(Excon).to receive(:post).
199
200
  with(excon_uri + "v1.12" + "/containers/12345/restart?t=30",
200
201
  client_cert: '/certs/cert.pem',
201
- client_key: '/certs/key.pem').
202
+ client_key: '/certs/key.pem',
203
+ read_timeout: 150).
202
204
  and_return(double(body: json_string, status: 204))
203
205
  api.restart_container('12345')
204
206
  end
@@ -207,7 +209,8 @@ describe Centurion::DockerViaApi do
207
209
  expect(Excon).to receive(:post).
208
210
  with(excon_uri + "v1.12" + "/containers/12345/restart?t=300",
209
211
  client_cert: '/certs/cert.pem',
210
- client_key: '/certs/key.pem').
212
+ client_key: '/certs/key.pem',
213
+ read_timeout: 420).
211
214
  and_return(double(body: json_string, status: 204))
212
215
  api.restart_container('12345', 300)
213
216
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: centurion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.8
4
+ version: 1.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Benders
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2016-12-19 00:00:00.000000000 Z
23
+ date: 2017-01-13 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: trollop
@@ -82,16 +82,16 @@ dependencies:
82
82
  name: rake
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ~>
86
86
  - !ruby/object:Gem::Version
87
- version: '0'
87
+ version: '10.5'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ~>
93
93
  - !ruby/object:Gem::Version
94
- version: '0'
94
+ version: '10.5'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rspec
97
97
  requirement: !ruby/object:Gem::Requirement