From 9c1951478f06a9244b5bdc5fbd356b3872543d24 Mon Sep 17 00:00:00 2001
From: Will Szumski <will@stackhpc.com>
Date: Thu, 22 Feb 2024 16:23:52 +0000
Subject: [PATCH] Skip buggy release of docker PyPI package

The tag regex is buggy and fails if the docker registry contains a port
number[1].

[1] https://github.com/docker/docker-py/issues/3195

Change-Id: I5d85e751b490ab1e39e417ff8797ca8f8688590b
Closes-Bug: #2054715
---
 ansible/roles/kolla/tasks/install.yml                 | 11 +++++++++--
 ...ocker-registry-contains-port-356dbaeeb8dd1e29.yaml |  6 ++++++
 zuul.d/jobs.yaml                                      |  1 -
 3 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 releasenotes/notes/fix-issue-building-images-when-docker-registry-contains-port-356dbaeeb8dd1e29.yaml

diff --git a/ansible/roles/kolla/tasks/install.yml b/ansible/roles/kolla/tasks/install.yml
index 09cbeb9e..33512762 100644
--- a/ansible/roles/kolla/tasks/install.yml
+++ b/ansible/roles/kolla/tasks/install.yml
@@ -67,7 +67,9 @@
     version: "{{ item.version | default(omit) }}"
     state: "{{ item.state | default('present') }}"
     virtualenv: "{{ kolla_venv }}"
-    extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
+    extra_args: "{{ item.extra_args | default(default_extra_args) }}"
+  vars:
+    default_extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
   with_items:
     # Install Kolla from source.
     - name: "{{ kolla_source_path }}"
@@ -77,5 +79,10 @@
       version: "{{ kolla_openstack_release }}"
       install: "{{ kolla_ctl_install_type == 'binary' }}"
     # Install docker from PyPI since it was dropped from kolla requirements.
-    - name: "docker"
+    # Skip 7.0.0 due to: https://github.com/docker/docker-py/issues/3195
+    - name: "docker!=7.0.0,<8"
+      # NOTE(wszumski): Workaround for ERROR: ResolutionImpossible when using upper constraints.
+      # This can be removed once a newer version of docker is released and the version in upper
+      # constraints has been bumped (>7.0.0).
+      extra_args: "{{ omit }}"
   when: item.install | default(True) | bool
diff --git a/releasenotes/notes/fix-issue-building-images-when-docker-registry-contains-port-356dbaeeb8dd1e29.yaml b/releasenotes/notes/fix-issue-building-images-when-docker-registry-contains-port-356dbaeeb8dd1e29.yaml
new file mode 100644
index 00000000..a9753ad8
--- /dev/null
+++ b/releasenotes/notes/fix-issue-building-images-when-docker-registry-contains-port-356dbaeeb8dd1e29.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Fixes issue building container images when docker registry contained a
+    port.  See `LP#2054715 <https://bugs.launchpad.net/kayobe/+bug/2054715>`__
+    for more details.
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index 91ec9bc7..05cf9b83 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -221,7 +221,6 @@
       Base job for testing seed image builds.
 
       Configures the primary VM as a seed.
-    voting: false
     vars:
       build_images: true
 
-- 
GitLab