Merge pull request 'Modify the logic to decide the download URL.' (#9) from modify-logic-to-decide-url into master
Reviewed-on: #9
This commit is contained in:
commit
0d1bcb5108
|
@ -12,7 +12,7 @@ begin
|
||||||
Timeout.timeout(3) do
|
Timeout.timeout(3) do
|
||||||
response = Net::HTTP.get_response(uri)
|
response = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
||||||
|
|
||||||
filestat_exporter_bin = "#{node['filestat_exporter']['prefix']}#{vtag}#{node['filestat_exporter']['postfix']}"
|
filestat_exporter_bin = "#{node['filestat_exporter']['prefix']}#{vtag}#{node['filestat_exporter']['postfix']}"
|
||||||
filestat_exporter_url = "#{node['filestat_exporter']['url']}/#{vtag}/#{filestat_exporter_bin}"
|
filestat_exporter_url = "#{node['filestat_exporter']['url']}/#{vtag}/#{filestat_exporter_bin}"
|
||||||
|
|
|
@ -13,7 +13,7 @@ begin
|
||||||
Timeout.timeout(3) do
|
Timeout.timeout(3) do
|
||||||
response = Net::HTTP.get_response(uri)
|
response = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
||||||
tag = vtag.sub(/^v/, '')
|
tag = vtag.sub(/^v/, '')
|
||||||
|
|
||||||
node_exporter_bin = "#{node['node_exporter']['prefix']}#{tag}#{node['node_exporter']['postfix']}"
|
node_exporter_bin = "#{node['node_exporter']['prefix']}#{tag}#{node['node_exporter']['postfix']}"
|
||||||
|
|
|
@ -13,7 +13,7 @@ begin
|
||||||
Timeout.timeout(3) do
|
Timeout.timeout(3) do
|
||||||
response = Net::HTTP.get_response(uri)
|
response = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
||||||
tag = vtag.sub(/^v/, '')
|
tag = vtag.sub(/^v/, '')
|
||||||
|
|
||||||
promtail_url = "#{node['promtail']['url']}/#{vtag}/#{node['promtail']['bin']}"
|
promtail_url = "#{node['promtail']['url']}/#{vtag}/#{node['promtail']['bin']}"
|
||||||
|
|
Loading…
Reference in New Issue