odania 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/odania/varnish.rb +10 -1
- data/lib/odania/version.rb +1 -1
- data/spec/lib/odania/varnish_spec.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: d506a9221ab23566539c2d3c4ef05591c9c52708
|
4
|
+
data.tar.gz: a875aed746071e7c03818b937af551bd59eae577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8808a430e8ace883a91f90fdb4300533b130e482ce1db76287966c9f5941ba8a97dc539e4364dd30422fe1d75b4764fc5605a43cc134dc47bf4b2598aa31155
|
7
|
+
data.tar.gz: 9ecdd650491184c8cb6ce4540c91c03c10b1c5ee5bca7fd1e87487501a3432c98b3460031cfd45228474f1670006d4ba8ad7060d6f0225981da1531c809d76c4
|
data/Gemfile.lock
CHANGED
data/lib/odania/varnish.rb
CHANGED
@@ -76,7 +76,7 @@ module Odania
|
|
76
76
|
|
77
77
|
ips = Odania.ips
|
78
78
|
plugin_config['plugin-config']['ips'] = ips
|
79
|
-
plugin_config['plugin-config']['ip'] = ips
|
79
|
+
plugin_config['plugin-config']['ip'] = primary_ip(ips)
|
80
80
|
plugin_config['plugin-config']['port'] = 80
|
81
81
|
plugin_config['plugin-config']['tags'] = ["plugin-#{get_plugin_name}"]
|
82
82
|
puts JSON.pretty_generate plugin_config if $debug
|
@@ -85,6 +85,15 @@ module Odania
|
|
85
85
|
Odania.plugin.register plugin_instance_name, plugin_config
|
86
86
|
end
|
87
87
|
|
88
|
+
# Rancher assigns two ip's the ip starting with 10. is routed through the hosts
|
89
|
+
def primary_ip(ips)
|
90
|
+
ips.each do |ip|
|
91
|
+
return ip if ip.start_with? '10.'
|
92
|
+
end
|
93
|
+
|
94
|
+
ips.first
|
95
|
+
end
|
96
|
+
|
88
97
|
def get_plugin_name
|
89
98
|
'odania_varnish'
|
90
99
|
end
|
data/lib/odania/version.rb
CHANGED
@@ -31,7 +31,7 @@ describe Odania::Varnish do
|
|
31
31
|
|
32
32
|
it 'generates the varnish config' do
|
33
33
|
$consul_mock.config.set('global_plugins_config', global_cfg)
|
34
|
-
expect(subject.generate('/tmp/varnish')).to eq(
|
34
|
+
expect(subject.generate('/tmp/varnish')).to eq("odania-varnish|odania_varnish_#{Socket.gethostname.gsub(/[^0-9a-zA-Z_]/, '_')}")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|