Skip to content

Commit 0bdc266

Browse files
committed
kolla-images.py: Fix container to image tag lookup corner case
The failing case was the haproxy image used by the neutron_tls_proxy container, if a tag is defined for the 'neutron' prefix but not 'haproxy'.
1 parent 0337190 commit 0bdc266

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/kolla-images.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,18 @@ def get_parent_tag_name(kolla_image_tags: KollaImageTags, base_distro: Optional[
151151
"""Return the parent tag variable for a container in the tag variable hierarchy."""
152152

153153
if container in CONTAINER_TO_PREFIX_VAR_EXCEPTIONS:
154-
parent = CONTAINER_TO_PREFIX_VAR_EXCEPTIONS[container]
155-
if parent in kolla_image_tags:
156-
return parent
154+
prefix_var = CONTAINER_TO_PREFIX_VAR_EXCEPTIONS[container]
155+
if prefix_var in kolla_image_tags:
156+
return prefix_var
157+
else:
158+
prefix_var = container
157159

158160
def tag_key(tag):
159161
"""Return a sort key to order the tags."""
160162
if tag == "openstack":
161163
# This is the default tag.
162164
return 0
163-
elif tag != container and container.startswith(tag) and (base_distro is None or base_distro in kolla_image_tags[tag]):
165+
elif tag != prefix_var and prefix_var.startswith(tag) and (base_distro is None or base_distro in kolla_image_tags[tag]):
164166
# Prefix match - sort by the longest match.
165167
return -len(tag)
166168
else:

0 commit comments

Comments
 (0)