Browse Source

Fix regexp for required images matching

Change-Id: I699bd497734e945791e0abc01cd0a5a739d72551
Artem Panchenko 2 years ago
parent
commit
de7c9a4fd7
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      fuel_ccp_tests/helpers/post_install_k8s_checks.py

+ 3
- 2
fuel_ccp_tests/helpers/post_install_k8s_checks.py View File

@@ -54,11 +54,12 @@ def required_images_exists(node_name, underlay, required_images):
54 54
     images = set([x.strip() for x in result['stdout']])
55 55
     LOG.debug('Containers on node "{0}" use images: '
56 56
               '{1}'.format(node_name, images))
57
-    # Image name could contain unpredictable Docker registry name
58
-    # (host:port), e.g. example.net:5000/hyperkube-amd64:v1.4.1
57
+    # Image name could contain unpredictable Docker registry name (host:port)
58
+    # and namespace, e.g. example.net:5000/mirantis/k8s/hyperkube-amd64:v1.4.1
59 59
     # Use regex to check that image (base name) is used by some container
60 60
     assert all(
61 61
         any(re.match('^([\w.-]+(:\d+)?/)?'  # Host:port (optional)
62
+                     '([\w/]+/)?'  # namespace and/or project name (optional)
62 63
                      '{0}:\S+$'  # image name + ":" + image tag
63 64
                      .format(required_image), image)
64 65
             for image in images)

Loading…
Cancel
Save