From 0f59b0d164ee0bfe106189a2704c6bfd5626df7b Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Mon, 5 Aug 2024 04:41:00 -0400 Subject: [PATCH] Fixed incorrect region endpoint in multi-region When using multi-region, octavia-dashboard used the keystone catalog of auth endpoint linked to the horizon session. But it should use the keystone endpoint of the selected region if it exists. Closes-Bug: #2076074 Change-Id: I8d90a7225361a88ebfd68e7f16724b302031eda6 --- octavia_dashboard/sdk_connection.py | 3 ++- .../fix-incorrect-region-endpoint-1afc5ebdc6fc4110.yaml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-incorrect-region-endpoint-1afc5ebdc6fc4110.yaml diff --git a/octavia_dashboard/sdk_connection.py b/octavia_dashboard/sdk_connection.py index 87e0e52a..d0fc67fe 100644 --- a/octavia_dashboard/sdk_connection.py +++ b/octavia_dashboard/sdk_connection.py @@ -16,6 +16,7 @@ from django.conf import settings import octavia_dashboard from openstack import config as occ from openstack import connection +from openstack_dashboard.api import base def get_sdk_connection(request): @@ -44,7 +45,7 @@ def get_sdk_connection(request): project_id=request.user.project_id, project_domain_id=request.user.domain_id, auth_token=request.user.token.unscoped_token, - auth_url=request.user.endpoint), + auth_url=base.url_for(request, 'identity')), app_name='octavia-dashboard', app_version=octavia_dashboard.__version__) return connection.from_config(cloud_config=cloud_config) diff --git a/releasenotes/notes/fix-incorrect-region-endpoint-1afc5ebdc6fc4110.yaml b/releasenotes/notes/fix-incorrect-region-endpoint-1afc5ebdc6fc4110.yaml new file mode 100644 index 00000000..925662b4 --- /dev/null +++ b/releasenotes/notes/fix-incorrect-region-endpoint-1afc5ebdc6fc4110.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed a bug when using multi-region deployments, the octavia-dashboard may + have used the wrong keystone catalog to get the load-balancer endpoint.