rancher-metadata 0.17.4 → 0.17.5
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 +4 -4
- data/README.md +1 -1
- data/lib/rancher-metadata/api.rb +13 -1
- 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: 5467d2c11bfe48b395bd83e5f825160da89c95d0
|
|
4
|
+
data.tar.gz: e577c1fe121ed79030fc9d51a58924640beb4694
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2944b89d04b249a8f4cf8d31370384ca271c108e97dc4f46942ac5318ac704050adf45188b3dfa74a21dc10b1b3b0603deaf7a10b09aaa328337ed889e00d8c1
|
|
7
|
+
data.tar.gz: 93f57158527773f4157f04a71b36d0cc9ecd3f32fbef56f11f0f6b43646eaa9440f57437ea9c927c937cb2ef98228ab24b21fde0891593147bfd9baf607ed9be
|
data/README.md
CHANGED
|
@@ -23,7 +23,7 @@ puts("Container service name: #{api.get_container_service_name}")
|
|
|
23
23
|
puts("Container hostname: #{api.get_container_hostname}")
|
|
24
24
|
|
|
25
25
|
api.wait_service_containers() do |name, container|
|
|
26
|
-
puts("Container #{name} is up (ip: #{container['primary_ip']}, create index: #{container['create_index']}, service suffix: #{
|
|
26
|
+
puts("Container #{name} is up (ip: #{container['primary_ip']}, create index: #{container['create_index']}, service suffix: #{container['service_suffix']})")
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
metadata = api.get_service_metadata
|
data/lib/rancher-metadata/api.rb
CHANGED
|
@@ -148,7 +148,18 @@ module RancherMetadata
|
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
def get_container(container_name = nil)
|
|
151
|
-
|
|
151
|
+
container = nil
|
|
152
|
+
|
|
153
|
+
if container_name
|
|
154
|
+
container = self.api_get("/containers/#{container_name}")
|
|
155
|
+
else
|
|
156
|
+
container = self.api_get("/self/container")
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# FIXME: https://github.com/rancher/cattle/pull/1197
|
|
160
|
+
container['service_suffix'] = self.get_container_service_suffix(container_name) unless container.has_key?('service_suffix')
|
|
161
|
+
|
|
162
|
+
container
|
|
152
163
|
end
|
|
153
164
|
|
|
154
165
|
def get_container_field(field, container_name = nil)
|
|
@@ -166,6 +177,7 @@ module RancherMetadata
|
|
|
166
177
|
|
|
167
178
|
def get_container_ip(container_name = nil)
|
|
168
179
|
if container_name
|
|
180
|
+
# FIXME: https://github.com/rancher/rancher/issues/2750
|
|
169
181
|
if self.is_network_managed?
|
|
170
182
|
self.api_get("/self/container/primary_ip")
|
|
171
183
|
else
|