consul-templaterb 1.26.0 → 1.26.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79f77f92ae3811c48a823724fb4fb242b78fb78713de126cc035de4089a5e607
4
- data.tar.gz: 3aa6c6f9c1aca03006963dd03ab30c3ba9ceabc4ff88c3a0d7fa8470a024b2d2
3
+ metadata.gz: 91552da1b0e2061c69095c958665896efc6de84ae6c5374a1b66d1c9550a3297
4
+ data.tar.gz: 8bdf67de550a4e2cb7d621ccad117e1e0841b3a0a49bcefb5c914e63daeddb41
5
5
  SHA512:
6
- metadata.gz: ed5763f1c109d678a867dddbe77a2b4e8d0b9adde1663f80e9bb6db2812c104f84edcd9f5c929d8e1f4763e9b4fa3af138da87c58af1285d6f1b0c6f5924760d
7
- data.tar.gz: af7a53d991a486b4050632576b36c2cb1fe5e899bee75ec73a2e6bd76bb18e350913e5703b69ee8a05aa51b2d64a64a60b8c17dcc1e071b8cac3544331de0600
6
+ metadata.gz: 24a9e291106b8e32ddef2bdc3d5e87ded36122c84dd1f0547fb034410d606609dd0041d011cd4eeb58da7b38a579888fb5901e877814d49926ef7a0722020d15
7
+ data.tar.gz: d3b1b5578cfdc3ee7c594916fc53e22692506d1bc0faaafd91ca21891665732528e95a384766548c90c75bcec0b515f856d1236ffbd18572911363d6ab8f836b
@@ -2,16 +2,23 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
- NEW FEATURES:
5
+ ## 1.26.1 (March 27, 2020)
6
+
7
+ BUGFIX:
8
+
9
+ * Using `agent: http://vault_or_consul_agent:port>` was not properly taken into account in some endpoints
6
10
 
7
11
  ## 1.26.0 (March 5, 2020)
8
12
 
13
+ NEW FEATURES:
14
+
9
15
  * Using `agent: http://vault_or_consul_agent:port>` on most methods will now override the agent
10
16
  used to perform Consul queries. It might be useful for very large clusters or large WAN federations,
11
17
  because you can perform some requests on some agents, and some others on other agenrs. Might
12
18
  also be useful to federate data from preprod/prod for instance.
13
- See [samples/all_services_multi_agents.txt.erb](samples/all_services_multi_agents.txt.erb) for an
14
- example.
19
+ * Added agent attribute for all methods in documentation
20
+ * Added [samples/all_services_multi_agents.txt.erb](samples/all_services_multi_agents.txt.erb) as an
21
+ example of new feature.
15
22
 
16
23
  ## 1.25.2 (February 29, 2020)
17
24
 
@@ -120,4 +120,5 @@ If you don’t want to bother configuring and tuning it, you can try it very qui
120
120
  * [Mixing Observability with Service Discovery](https://medium.com/criteo-labs/mixing-observability-with-service-discovery-2bb8909e8530)
121
121
 
122
122
  Pierre Souchay, 2020-03-03
123
- Also published on https://medium.com/criteo-labs/template-based-discovery-with-consul-templaterb-8ff88434c457
123
+
124
+ Also published on https://medium.com/criteo-labs/template-based-discovery-with-consul-templaterb-8ff88434c457
@@ -53,7 +53,7 @@ module Consul
53
53
  query_params = {}
54
54
  query_params[:dc] = dc if dc
55
55
  @endp_manager.create_if_missing(path, query_params, agent: agent) do
56
- ConsulTemplateNodes.new(ConsulEndpoint.new(@endp_manager.consul_conf, path, true, query_params, '[]', agent: agent))
56
+ ConsulTemplateNodes.new(ConsulEndpoint.new(@endp_manager.consul_conf, path, true, query_params, '[]', agent))
57
57
  end
58
58
  end
59
59
 
@@ -63,7 +63,7 @@ module Consul
63
63
  query_params = {}
64
64
  query_params[:dc] = dc if dc
65
65
  @endp_manager.create_if_missing(path, query_params, agent: agent) do
66
- ConsulTemplateNodes.new(ConsulEndpoint.new(@endp_manager.consul_conf, path, true, query_params, '[]', agent: agent))
66
+ ConsulTemplateNodes.new(ConsulEndpoint.new(@endp_manager.consul_conf, path, true, query_params, '[]', agent))
67
67
  end
68
68
  end
69
69
 
@@ -136,7 +136,7 @@ module Consul
136
136
  query_params[:dc] = dc if dc
137
137
  query_params[:passing] = passing if passing
138
138
  query_params[:tag] = tag if tag
139
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateService.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]')) }
139
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateService.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]', agent)) }
140
140
  end
141
141
 
142
142
  # https://www.consul.io/api/health.html#list-checks-for-service
@@ -147,7 +147,7 @@ module Consul
147
147
  query_params = {}
148
148
  query_params[:dc] = dc if dc
149
149
  query_params[:passing] = passing if passing
150
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateChecks.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]')) }
150
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateChecks.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]', agent)) }
151
151
  end
152
152
 
153
153
  # https://www.consul.io/api/health.html#list-checks-for-node
@@ -158,7 +158,7 @@ module Consul
158
158
  query_params = {}
159
159
  query_params[:dc] = dc if dc
160
160
  query_params[:passing] = passing if passing
161
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateChecks.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]')) }
161
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateChecks.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]', agent)) }
162
162
  end
163
163
 
164
164
  # https://www.consul.io/api/catalog.html#list-nodes
@@ -166,7 +166,7 @@ module Consul
166
166
  path = '/v1/catalog/nodes'
167
167
  query_params = {}
168
168
  query_params[:dc] = dc if dc
169
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateNodes.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]')) }
169
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateNodes.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]', agent)) }
170
170
  end
171
171
 
172
172
  # https://www.consul.io/api/catalog.html#list-services-for-node
@@ -174,7 +174,7 @@ module Consul
174
174
  path = "/v1/catalog/node/#{name_or_id}"
175
175
  query_params = {}
176
176
  query_params[:dc] = dc if dc
177
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateNodes.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '{}')) }
177
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateNodes.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '{}', agent)) }
178
178
  end
179
179
 
180
180
  # https://www.consul.io/api/agent.html#read-configuration
@@ -182,7 +182,7 @@ module Consul
182
182
  path = '/v1/agent/self'
183
183
  query_params = {}
184
184
  default_value = '{"Config":{}, "Coord":{}, "Member":{}, "Meta":{}, "Stats":{}}'
185
- create_if_missing(path, query_params, agent: agent) { ConsulAgentSelf.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value)) }
185
+ create_if_missing(path, query_params, agent: agent) { ConsulAgentSelf.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value, agent)) }
186
186
  end
187
187
 
188
188
  # https://www.consul.io/api/agent.html#view-metrics
@@ -190,7 +190,7 @@ module Consul
190
190
  path = '/v1/agent/metrics'
191
191
  query_params = {}
192
192
  default_value = '{"Gauges":[], "Points":[], "Member":{}, "Counters":[], "Samples":{}}'
193
- create_if_missing(path, query_params, agent: agent) { ConsulAgentMetrics.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value)) }
193
+ create_if_missing(path, query_params, agent: agent) { ConsulAgentMetrics.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value, agent)) }
194
194
  end
195
195
 
196
196
  # https://www.consul.io/api/agent.html#list-members
@@ -199,7 +199,7 @@ module Consul
199
199
  query_params = {}
200
200
  query_params['wan'] = true if wan
201
201
  default_value = '[]'
202
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateMembers.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value)) }
202
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateMembers.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value, agent)) }
203
203
  end
204
204
 
205
205
  # Return a param of template
@@ -222,14 +222,14 @@ module Consul
222
222
  query_params[:dc] = dc if dc
223
223
  # Tag filtering is performed on client side
224
224
  query_params[:tag] = tag if tag
225
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateServices.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '{}')) }
225
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateServices.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '{}', agent)) }
226
226
  end
227
227
 
228
228
  # https://www.consul.io/api/catalog.html#list-datacenters
229
229
  def datacenters(agent: nil)
230
230
  path = '/v1/catalog/datacenters'
231
231
  query_params = {}
232
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateDatacenters.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]')) }
232
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateDatacenters.new(ConsulEndpoint.new(consul_conf, path, true, query_params, '[]', agent)) }
233
233
  end
234
234
 
235
235
  # https://www.consul.io/api/kv.html#read-key
@@ -240,7 +240,7 @@ module Consul
240
240
  query_params[:recurse] = recurse if recurse
241
241
  query_params[:keys] = keys if keys
242
242
  default_value = '[]'
243
- create_if_missing(path, query_params, agent: agent) { ConsulTemplateKV.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value), name) }
243
+ create_if_missing(path, query_params, agent: agent) { ConsulTemplateKV.new(ConsulEndpoint.new(consul_conf, path, true, query_params, default_value, agent), name) }
244
244
  end
245
245
 
246
246
  def secrets(path = '', agent: nil)
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.26.0'.freeze
3
+ VERSION = '1.26.1'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,12 @@
1
+ <%
2
+ r = /^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,62}[a-zA-Z0-9])?$/
3
+ invalid_services = {}
4
+ services.each do |servive_name, tags|
5
+ errors = []
6
+ errors << "Invalid service name #{servive_name}" unless r.match(servive_name)
7
+ tags.each do |tag|
8
+ errors << "Invalid tag #{tag}" unless r.match(tag)
9
+ end
10
+ invalid_services[servive_name] = errors unless errors.empty?
11
+ end
12
+ %><%= JSON.pretty_generate({"errors": invalid_services.size, "details": invalid_services}) %>
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.26.0
4
+ version: 1.26.1
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: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request
@@ -229,6 +229,7 @@ files:
229
229
  - samples/criteo/haproxy.cfg.erb
230
230
  - samples/debug/compare_connect_services.txt.erb
231
231
  - samples/demos/compute_pricing.txt.erb
232
+ - samples/find_all_invalid_dns_labels.json.erb
232
233
  - samples/ha_proxy.cfg.erb
233
234
  - samples/haproxy_dns.cfg.erb
234
235
  - samples/hosts.erb