consul-templaterb 1.9.5 → 1.9.6

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: 641ec7ace0ee7b0bdad06b8cbaef7ceba31b520f0302ef3504cee674e48344ed
4
- data.tar.gz: 7d996fff12f90c62b9a402342ad4b51265ae2dc59df53cdd9ee3774aabe62b29
3
+ metadata.gz: d97e523ed7d46b52d6f8076263af42d649f01f74085d5ae58a613cf38ab14e31
4
+ data.tar.gz: 99255a8e34cae9c05d685f88df56452b77b939d99c6c0b0d48fa3b2156e40457
5
5
  SHA512:
6
- metadata.gz: 5f904d40d4b51ca467ac13455bca0047ead220e2377143b33d610b44479b5d480ca5cec055f4628de2bde86df03711d56c3c65f5bd870b4ea3ad4a0e0a8f4adb
7
- data.tar.gz: e653a1d9c5e2656110cb7168e4f825b4a2eb3b4cee951ad1bce2ba574f311f0f65ee800d34eceb61a18458f68b593531d2ccd3dd72fa4b04306cbdf20f542bc4
6
+ metadata.gz: b6c10ccb302c52e4c97d5b7620b6123cbbca69abe720b8ef2764fbc30fd449ea5fc89412ad9bf7ade0de3c8f12b67dcb5d6058159cf3db212bf452c6efaa9067
7
+ data.tar.gz: 168bf127d58cff2c48de8cddda29b6eeac7d113563c61b15dea881fbfb2339e46b69734ad681ba6d3298d50a548b87707faea3d506ce9188f7580de321126b8f
data/.rubocop.yml CHANGED
@@ -28,7 +28,7 @@ Metrics/ParameterLists:
28
28
  Max: 12
29
29
 
30
30
  Metrics/PerceivedComplexity:
31
- Max: 20
31
+ Max: 22
32
32
 
33
33
  Style/Documentation:
34
34
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.9.6 (January 15, 2019)
6
+
7
+ BUGFIX:
8
+
9
+ * Keep connections open properly as it increase timeouts on Consul servers on
10
+ very large templates
11
+
12
+ IMPROVEMENTS:
13
+
14
+ * Display error message when Retrying every 10 errors
15
+
5
16
  ## 1.9.5 (January 14, 2019)
6
17
 
7
18
  BUGFIX:
@@ -215,7 +215,9 @@ module Consul
215
215
  # Dirty hack, but contrary to other path, when key is not present, Consul returns 404
216
216
  is_kv_empty = path.start_with?('/v1/kv') && http.response_header.status == 404
217
217
  if !is_kv_empty && enforce_json_200 && http.response_header.status != 200 && http.response_header['Content-Type'] != 'application/json'
218
- _handle_error(http, consul_index) { connection[:conn] = EventMachine::HttpRequest.new(conf.base_url, options) }
218
+ _handle_error(http, consul_index) do
219
+ STDERR.puts "[RETRY][#{path}] (#{@consecutive_errors} errors)" if (@consecutive_errors % 10) == 1
220
+ end
219
221
  else
220
222
  n_consul_index = find_x_consul_index(http)
221
223
  @x_consul_index = n_consul_index.to_i if n_consul_index
@@ -250,7 +252,7 @@ module Consul
250
252
  http.errback do
251
253
  unless @stopping
252
254
  _handle_error(http, consul_index) do
253
- connection[:conn] = EventMachine::HttpRequest.new(conf.base_url, options)
255
+ STDERR.puts "[RETRY][#{path}] (#{@consecutive_errors} errors) due to #{http.error}" if (@consecutive_errors % 10) == 1
254
256
  end
255
257
  end
256
258
  end
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.9.5'.freeze
3
+ VERSION = '1.9.6'.freeze
4
4
  end
5
5
  end
@@ -32,12 +32,17 @@ cur_state = services.map do |service_name, _tags|
32
32
  instances = snodes
33
33
  .sort { |a, b| a['Node']['Node'] <=> b['Node']['Node'] }
34
34
  .map do |instance|
35
+ mod_index = instance['Service']['ModifyIndex'] || 0
36
+ instance['Checks'].each do |chk|
37
+ mindex = chk['ModifyIndex'] || 0
38
+ mod_index = mindex if mod_index < mindex
39
+ end
35
40
  ["#{instance['Node']['Node']}:#{instance['Service']['ID']}",
36
41
  {
37
42
  'address' => instance.service_address,
38
43
  'node' => instance['Node']['Node'],
39
44
  'port' => instance['Service']['Port'],
40
- 'idx' => (instance['Service']['ModifyIndex'] || cur_index).to_i,
45
+ 'idx' => mod_index || cur_index,
41
46
  'status' => instance.status,
42
47
  'stats' => cur_stats,
43
48
  'checks' => instance['Checks'].map { |check| [check['CheckID'], { 'name' => check['Name'], 'status' => check['Status'], 'output' => check['Output'] }] }.to_h
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul-templaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-14 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request