rancher-metadata 0.17.6 → 0.17.8

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
  SHA1:
3
- metadata.gz: 38c14d5544623d8b458cf07d755076ee1ab17d3b
4
- data.tar.gz: 26551f94119a6e2138bf661117d288448f9cd169
3
+ metadata.gz: 58557aa34fbd096e4379591f47e3892703f2060f
4
+ data.tar.gz: 08228fefab2525dee8cc44d98203ad24621a21f7
5
5
  SHA512:
6
- metadata.gz: 24e2407029c80893a31afe03985e11053bc1b85e1ec38fb4367293ad4985f5d1e929ed84e4215bfcac6c382b170ceb8f34b59874bafb42295933ba418b2ea06f
7
- data.tar.gz: 7d29af0125a22396877c5191971b34fc2e0febc5714f19857179454d23f5c4ab8af6e78a718a63795ad52729bdc594c13951ef09f1d87e96d1f946c4f95908af
6
+ metadata.gz: c49a47f8c5e682230e7e34051830ac1502ff449dd61a8179aa830f3b3810e881eb1d1d9144341d789d3a65d0e83efba27b454ba4732cc3f41fb83c80db738ef7
7
+ data.tar.gz: 04152d95bf737f16503a33f0619f473151345f37252dd98f46818169077c7c9166358f16c41165576fc760be058c8065b308f6561680ef530febfba2fc42df25
@@ -100,7 +100,16 @@ module RancherMetadata
100
100
  end
101
101
 
102
102
  def get_service_containers(service = {})
103
- self.get_service_field("containers", service)
103
+ containers = {}
104
+
105
+ self.get_service_field("containers", service).each do |container|
106
+ containers[container['name']] = container
107
+
108
+ # FIXME: until https://github.com/rancher/cattle/pull/1197 gets merged
109
+ containers[container['name']]['service_suffix'] = self.get_container_service_suffix(container['name']) unless container.has_key?('service_suffix')
110
+ end
111
+
112
+ containers
104
113
  end
105
114
 
106
115
  def get_service_metadata(service = {})
@@ -119,8 +128,11 @@ module RancherMetadata
119
128
  containers = self.get_service_containers(service)
120
129
  new = containers.keys()
121
130
 
122
- (new - old).each do |n|
123
- yield(n, containers[n])
131
+ (new - old).each do |container_name|
132
+ # FIXME: until https://github.com/rancher/cattle/pull/1197 gets merged
133
+ containers[container_name]['service_suffix'] = self.get_container_service_suffix(container_name) unless containers[container_name].has_key?('service_suffix')
134
+
135
+ yield(container_name, containers[container_name])
124
136
  end
125
137
 
126
138
  old = new
@@ -156,7 +168,7 @@ module RancherMetadata
156
168
  container = self.api_get("/self/container")
157
169
  end
158
170
 
159
- # FIXME: https://github.com/rancher/cattle/pull/1197
171
+ # FIXME: until https://github.com/rancher/cattle/pull/1197 gets merged
160
172
  container['service_suffix'] = self.get_container_service_suffix(container_name) unless container.has_key?('service_suffix')
161
173
 
162
174
  container
@@ -177,6 +189,7 @@ module RancherMetadata
177
189
 
178
190
  def get_container_ip(container_name = nil)
179
191
  if container_name
192
+ # are we running within the rancher managed network?
180
193
  # FIXME: https://github.com/rancher/rancher/issues/2750
181
194
  if self.is_network_managed?
182
195
  self.api_get("/self/container/primary_ip")
@@ -5,7 +5,7 @@
5
5
  #
6
6
 
7
7
  module RancherMetadata
8
- VERSION = "0.17.6"
8
+ VERSION = "0.17.8"
9
9
 
10
10
  def self.version
11
11
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rancher-metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.6
4
+ version: 0.17.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti