summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolodymyr Shypyguzov <vshypyguzov@mirantis.com>2016-11-16 16:34:10 +0200
committerVolodymyr Shypyguzov <vshypyguzov@mirantis.com>2016-11-18 13:32:37 +0200
commit401621434ef8263fb8f422be724cc20cdc91c8af (patch)
tree41955dd8afc00a1a38084a532afbf09ebf3d6b15
parent457facba037430617af5016be877707934c744ff (diff)
Log additional hyperkube info after cluster deployment
Since we no longer have additional info in the hyperkube image tag gather this info using docker inspect Change-Id: I3a68da3c84071f6d093e35e5a56737ce8f6d088c
Notes
Notes (review): Verified+1: Mirantis CCP CI <mirantis-fuel-ccp-ci@mirantis.com> Code-Review+2: Artem Panchenko <apanchenko@mirantis.com> Workflow+1: Volodymyr Shypyguzov <vshypyguzov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 18 Nov 2016 13:39:05 +0000 Reviewed-on: https://review.openstack.org/398384 Project: openstack/fuel-ccp-tests Branch: refs/heads/master
-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