summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-18 13:39:05 +0000
committerGerrit Code Review <review@openstack.org>2016-11-18 13:39:05 +0000
commitbbd10ffdddf79b1aaa26845751de760b8dfe66ed (patch)
tree92b08ff10c4066f4a530071f4c2553b9ea0264b1
parentcc292bdd50b0b39ffcdfbe36b7309b02c07f0eb1 (diff)
parent401621434ef8263fb8f422be724cc20cdc91c8af (diff)
Merge "Log additional hyperkube info after cluster deployment"
-rw-r--r--fuel_ccp_tests/helpers/post_install_k8s_checks.py26
-rw-r--r--fuel_ccp_tests/managers/k8smanager.py9
2 files changed, 35 insertions, 0 deletions
diff --git a/fuel_ccp_tests/helpers/post_install_k8s_checks.py b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
index aa9e0a4..ce37343 100644
--- a/fuel_ccp_tests/helpers/post_install_k8s_checks.py
+++ b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
@@ -13,6 +13,7 @@
13# under the License. 13# under the License.
14 14
15import re 15import re
16import json
16 17
17from devops.helpers import helpers 18from devops.helpers import helpers
18 19
@@ -61,3 +62,28 @@ def required_images_exists(node_name, underlay, required_images):
61 .format(required_image), image) 62 .format(required_image), image)
62 for image in images) 63 for image in images)
63 for required_image in required_images) 64 for required_image in required_images)
65
66
67def inspect_docker_containers(image_name, underlay, host_ip):
68 result = None
69 cmd = "docker inspect " \
70 "$(docker ps --filter ancestor={image_name} --format={{{{.ID}}}})"\
71 .format(image_name=image_name)
72 if underlay:
73 with underlay.remote(host=host_ip) as remote:
74 result = remote.execute(cmd)
75 if result:
76 LOG.info("Inspecting running containers with name={name}: on: {node}".
77 format(name=image_name, node=host_ip))
78 for container in result.stdout_json:
79 raw_out = container['Config']['Labels']
80 labels = json.dumps(
81 raw_out,
82 indent=4,
83 separators=(',', ': '),
84 sort_keys=True
85 )
86 LOG.info("Docker container {name} Labels: {labels}".format(
87 name=container['Name'],
88 labels=labels)
89 )
diff --git a/fuel_ccp_tests/managers/k8smanager.py b/fuel_ccp_tests/managers/k8smanager.py
index 998caa2..e4a9c98 100644
--- a/fuel_ccp_tests/managers/k8smanager.py
+++ b/fuel_ccp_tests/managers/k8smanager.py
@@ -20,6 +20,7 @@ from devops.helpers import helpers
20 20
21from fuel_ccp_tests.helpers import exceptions 21from fuel_ccp_tests.helpers import exceptions
22from fuel_ccp_tests.helpers import _subprocess_runner 22from fuel_ccp_tests.helpers import _subprocess_runner
23from fuel_ccp_tests.helpers import post_install_k8s_checks
23from fuel_ccp_tests import logger 24from fuel_ccp_tests import logger
24from fuel_ccp_tests import settings 25from fuel_ccp_tests import settings
25from fuel_ccp_tests.managers.k8s import cluster 26from fuel_ccp_tests.managers.k8s import cluster
@@ -158,6 +159,14 @@ class K8SManager(object):
158 159
159 self.mark_lvm_nodes(lvm_config) 160 self.mark_lvm_nodes(lvm_config)
160 161
162 hkube_image_name = '{}:{}'.format(
163 settings.HYPERKUBE_IMAGE_REPO, settings.HYPERKUBE_IMAGE_TAG
164 )
165 post_install_k8s_checks.inspect_docker_containers(
166 image_name=hkube_image_name,
167 underlay=self.__underlay,
168 host_ip=k8s_admin_ip)
169
161 return result 170 return result
162 171
163 @property 172 @property