From de7c9a4fd7803c009ce0d0f9914c1522a987b27c Mon Sep 17 00:00:00 2001 From: Artem Panchenko Date: Tue, 29 Nov 2016 16:02:37 +0200 Subject: [PATCH] Fix regexp for required images matching Change-Id: I699bd497734e945791e0abc01cd0a5a739d72551 --- fuel_ccp_tests/helpers/post_install_k8s_checks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuel_ccp_tests/helpers/post_install_k8s_checks.py b/fuel_ccp_tests/helpers/post_install_k8s_checks.py index f71c312..c85ffd9 100644 --- a/fuel_ccp_tests/helpers/post_install_k8s_checks.py +++ b/fuel_ccp_tests/helpers/post_install_k8s_checks.py @@ -54,11 +54,12 @@ def required_images_exists(node_name, underlay, required_images): images = set([x.strip() for x in result['stdout']]) LOG.debug('Containers on node "{0}" use images: ' '{1}'.format(node_name, images)) - # Image name could contain unpredictable Docker registry name - # (host:port), e.g. example.net:5000/hyperkube-amd64:v1.4.1 + # Image name could contain unpredictable Docker registry name (host:port) + # and namespace, e.g. example.net:5000/mirantis/k8s/hyperkube-amd64:v1.4.1 # Use regex to check that image (base name) is used by some container assert all( any(re.match('^([\w.-]+(:\d+)?/)?' # Host:port (optional) + '([\w/]+/)?' # namespace and/or project name (optional) '{0}:\S+$' # image name + ":" + image tag .format(required_image), image) for image in images)