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 +4 -4
- data/lib/rancher-metadata/api.rb +17 -4
- data/lib/rancher-metadata/version.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: 58557aa34fbd096e4379591f47e3892703f2060f
|
4
|
+
data.tar.gz: 08228fefab2525dee8cc44d98203ad24621a21f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c49a47f8c5e682230e7e34051830ac1502ff449dd61a8179aa830f3b3810e881eb1d1d9144341d789d3a65d0e83efba27b454ba4732cc3f41fb83c80db738ef7
|
7
|
+
data.tar.gz: 04152d95bf737f16503a33f0619f473151345f37252dd98f46818169077c7c9166358f16c41165576fc760be058c8065b308f6561680ef530febfba2fc42df25
|
data/lib/rancher-metadata/api.rb
CHANGED
@@ -100,7 +100,16 @@ module RancherMetadata
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def get_service_containers(service = {})
|
103
|
-
|
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 |
|
123
|
-
|
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")
|