odania 0.0.25 → 0.0.26

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: 4d869250e9939f0bd3314c657810dfa7f54c0492
4
- data.tar.gz: 83cd00c003898d412f13c10caaf5071d3094f583
3
+ metadata.gz: 2e6ea9cc26aac7bc522c8c1b2cc013e2f8447eec
4
+ data.tar.gz: 12385a1121bb13a63b345e93cb03c07d5d68a637
5
5
  SHA512:
6
- metadata.gz: e5eada7c634669f18bb2e0687c986eda0e6a88e91c1f01f22099f83bb5d65c314112a3bfcf9b417b21b4e228d520a2406459f3bd7b6b47610bf01946faa6a4c6
7
- data.tar.gz: e9d540901337d77fbaf3c513ed0910e43933a36dfd98ff2f2170c809538e96aaf9af0a5473803994f1221d0620e5d26cc45e6d1d8fb4f46136c340406723cd9c
6
+ metadata.gz: 90754f18b3e3b4a9933f80af8f6d6c2f8b776d0cbabfdba331d617bb24edc122861ef5c314bf5fb3b352bf34136bddec10178b50e560148723e7b4a9e603da2f
7
+ data.tar.gz: 4a11f48c9655021c224a3b68fbad1e053528fbf58e6f66c8bb6aa86f6fcfa3b13e6a377e219cdd914c2b32ded1411cba54e383885f1742c9696559ed59a19f59
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- odania (0.0.25)
4
+ odania (0.0.26)
5
5
  deep_merge
6
6
  diplomat
7
7
  erubis
@@ -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'] = primary_ip(ips)
79
+ plugin_config['plugin-config']['ip'] = Odania.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,15 +85,6 @@ 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
-
97
88
  def get_plugin_name
98
89
  'odania_varnish'
99
90
  end
@@ -1,3 +1,3 @@
1
1
  module Odania
2
- VERSION = '0.0.25'
2
+ VERSION = '0.0.26'
3
3
  end
data/lib/odania.rb CHANGED
@@ -47,6 +47,15 @@ module Odania
47
47
  ips
48
48
  end
49
49
 
50
+ # Rancher assigns two ip's the ip starting with 10. is routed through the hosts
51
+ def self.primary_ip(ips)
52
+ ips.each do |ip|
53
+ return ip if ip.start_with? '10.'
54
+ end
55
+
56
+ ips.first
57
+ end
58
+
50
59
  def self.varnish_sanitize(name)
51
60
  raise 'Could not sanitize varnish name!!' if name.nil?
52
61
  name.gsub(/[^0-9a-zA-Z_]/, '_')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odania
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Petersen