fix(horizon): apply a patch to fix resource provider panel (#1675)
upstream patch: https://review.opendev.org/c/openstack/horizon/+/924729
Reviewed-by: Mohammed Naser <mnaser@vexxhost.com>
diff --git a/images/horizon/Dockerfile b/images/horizon/Dockerfile
index de28177..807ccf8 100644
--- a/images/horizon/Dockerfile
+++ b/images/horizon/Dockerfile
@@ -4,7 +4,7 @@
ARG RELEASE
FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
-ARG HORIZON_GIT_REF=3f1f1d46e6e47a3dbe46fb023fe69ff25d6a601b
+ARG HORIZON_GIT_REF=14212342cf8f7eb987e50de112958af31063e02e
ADD --keep-git-dir=true https://opendev.org/openstack/horizon.git#${HORIZON_GIT_REF} /src/horizon
RUN git -C /src/horizon fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/designate-dashboard.git#master /src/designate-dashboard
@@ -21,6 +21,8 @@
RUN git -C /src/neutron-vpnaas-dashboard fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/octavia-dashboard.git#master /src/octavia-dashboard
RUN git -C /src/octavia-dashboard fetch --unshallow
+COPY patches/horizon /patches/horizon
+RUN git -C /src/horizon apply --verbose /patches/horizon/*
COPY patches/magnum-ui /patches/magnum-ui
RUN git -C /src/magnum-ui apply --verbose /patches/magnum-ui/*
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
diff --git a/images/horizon/patches/horizon/0000-normalize-url-join-for-placement.patch b/images/horizon/patches/horizon/0000-normalize-url-join-for-placement.patch
new file mode 100644
index 0000000..0dcd97a
--- /dev/null
+++ b/images/horizon/patches/horizon/0000-normalize-url-join-for-placement.patch
@@ -0,0 +1,43 @@
+From 7bd576495a0d9c1132962794f1b5d2032d66c24c Mon Sep 17 00:00:00 2001
+From: okozachenko <okozachenko1203@gmail.com>
+Date: Tue, 23 Jul 2024 23:28:28 +1000
+Subject: [PATCH] fix: normalize url join for placement uris
+
+Change-Id: Idcf00a91c1545e9693bb2e73e424958c5bb75e9c
+---
+
+diff --git a/openstack_dashboard/api/placement.py b/openstack_dashboard/api/placement.py
+index 98b51cd..643dde4 100644
+--- a/openstack_dashboard/api/placement.py
++++ b/openstack_dashboard/api/placement.py
+@@ -10,6 +10,8 @@
+ # License for the specific language governing permissions and limitations
+ # under the License.
+
++from urllib.parse import urljoin
++
+ from django.conf import settings
+ from keystoneauth1 import adapter
+ from keystoneauth1 import identity
+@@ -55,7 +57,11 @@
+
+ def _get_json(request, path):
+ adapter = make_adapter(request)
+- uri = base.url_for(request, 'placement') + path
++ base_uri = base.url_for(request, 'placement')
++ if not base_uri.endswith('/'):
++ base_uri += '/'
++ normalized_path = path.lstrip('/')
++ uri = urljoin(base_uri, normalized_path)
+ response, body = adapter.get(uri)
+ return response.json()
+
+diff --git a/releasenotes/notes/fix-placement-uri-generation-3b7586c163189608.yaml b/releasenotes/notes/fix-placement-uri-generation-3b7586c163189608.yaml
+new file mode 100644
+index 0000000..1531baa
+--- /dev/null
++++ b/releasenotes/notes/fix-placement-uri-generation-3b7586c163189608.yaml
+@@ -0,0 +1,3 @@
++---
++fixes:
++ - Use urljoin for normalized uri generation for placement apis