From 7e390312eaf3cbbf89d46b05dd20b5296d61616d Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 9 Jul 2021 21:42:32 +0000 Subject: [PATCH] Change the Octavia Barbican namespace The octavia dashboard has a built-in barbican rest API client used to access barbican for certificate selection during load blanancer creation. Unfortunately, this client used the "barbican" namespace, which is now used by the barbican-ui dashboard. This patch renames the octavia client namespace to be octavia-barbican to eliminate any namespace collisions with the barbican-ui dashboard. Change-Id: Idec2c182b2758a148ae9d0efa251510d5e7985a3 --- octavia_dashboard/api/rest/barbican.py | 4 ++-- ....service.js => octavia-barbican.service.js} | 18 +++++++++--------- ...pec.js => octavia-barbican.service.spec.js} | 12 +++++++----- .../project/lbaasv2/workflow/model.service.js | 10 +++++----- .../lbaasv2/workflow/model.service.spec.js | 2 +- ...sion-with-barbican-ui-267f4ba074729ea6.yaml | 4 ++++ 6 files changed, 28 insertions(+), 22 deletions(-) rename octavia_dashboard/static/app/core/openstack-service-api/{barbican.service.js => octavia-barbican.service.js} (76%) rename octavia_dashboard/static/app/core/openstack-service-api/{barbican.service.spec.js => octavia-barbican.service.spec.js} (87%) create mode 100644 releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml diff --git a/octavia_dashboard/api/rest/barbican.py b/octavia_dashboard/api/rest/barbican.py index f1c27721..12695b58 100644 --- a/octavia_dashboard/api/rest/barbican.py +++ b/octavia_dashboard/api/rest/barbican.py @@ -52,7 +52,7 @@ class SSLCertificates(generic.View): """API for working with SSL certificate containers. """ - url_regex = r'barbican/certificates/$' + url_regex = r'octavia-barbican/certificates/$' @rest_utils.ajax() def get(self, request): @@ -72,7 +72,7 @@ class Secrets(generic.View): """API for working with secrets. """ - url_regex = r'barbican/secrets/$' + url_regex = r'octavia-barbican/secrets/$' @rest_utils.ajax() def get(self, request): diff --git a/octavia_dashboard/static/app/core/openstack-service-api/barbican.service.js b/octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.js similarity index 76% rename from octavia_dashboard/static/app/core/openstack-service-api/barbican.service.js rename to octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.js index d40d336d..f9aba0ab 100644 --- a/octavia_dashboard/static/app/core/openstack-service-api/barbican.service.js +++ b/octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.js @@ -18,23 +18,23 @@ angular .module('horizon.app.core.openstack-service-api') - .factory('horizon.app.core.openstack-service-api.barbican', barbicanAPI); + .factory('horizon.app.core.openstack-service-api.octavia-barbican', octaviaBarbicanAPI); - barbicanAPI.$inject = [ + octaviaBarbicanAPI.$inject = [ 'horizon.framework.util.http.service', 'horizon.framework.widgets.toast.service' ]; /** * @ngdoc service - * @name horizon.app.core.openstack-service-api.barbican + * @name horizon.app.core.openstack-service-api.octavia-barbican * @description Provides direct pass through to barbican with NO abstraction. * @param apiService The horizon core API service. * @param toastService The horizon toast service. - * @returns The barbican service API. + * @returns The octavia barbican service API. */ - function barbicanAPI(apiService, toastService) { + function octaviaBarbicanAPI(apiService, toastService) { var service = { getCertificates: getCertificates, getSecrets: getSecrets @@ -47,7 +47,7 @@ // SSL Certificate Containers /** - * @name horizon.app.core.openstack-service-api.barbican.getCertificates + * @name horizon.app.core.openstack-service-api.octavia-barbican.getCertificates * @description * Get a list of SSL certificate containers. * @@ -57,7 +57,7 @@ */ function getCertificates(quiet) { - var promise = apiService.get('/api/barbican/certificates/'); + var promise = apiService.get('/api/octavia-barbican/certificates/'); return quiet ? promise : promise.error(function handleError() { toastService.add('error', gettext('Unable to retrieve SSL certificates.')); }); @@ -66,7 +66,7 @@ // Secrets /** - * @name horizon.app.core.openstack-service-api.barbican.getSecrets + * @name horizon.app.core.openstack-service-api.octavia-barbican.getSecrets * @description * Get a list of secrets. * @@ -76,7 +76,7 @@ */ function getSecrets(quiet) { - var promise = apiService.get('/api/barbican/secrets/'); + var promise = apiService.get('/api/octavia-barbican/secrets/'); return quiet ? promise : promise.error(function handleError() { toastService.add('error', gettext('Unable to retrieve secrets.')); }); diff --git a/octavia_dashboard/static/app/core/openstack-service-api/barbican.service.spec.js b/octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.spec.js similarity index 87% rename from octavia_dashboard/static/app/core/openstack-service-api/barbican.service.spec.js rename to octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.spec.js index eb04eb3b..dce1ca80 100644 --- a/octavia_dashboard/static/app/core/openstack-service-api/barbican.service.spec.js +++ b/octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.spec.js @@ -27,9 +27,11 @@ beforeEach(module('horizon.app.core.openstack-service-api')); - beforeEach(inject(['horizon.app.core.openstack-service-api.barbican', function(barbicanAPI) { - service = barbicanAPI; - }])); + beforeEach( + inject(['horizon.app.core.openstack-service-api.octavia-barbican', + function(octaviaBarbicanAPI) { + service = octaviaBarbicanAPI; + }])); it('defines the service', function() { expect(service).toBeDefined(); @@ -39,13 +41,13 @@ { func: "getCertificates", method: "get", - path: "/api/barbican/certificates/", + path: "/api/octavia-barbican/certificates/", error: "Unable to retrieve SSL certificates." }, { func: "getSecrets", method: "get", - path: "/api/barbican/secrets/", + path: "/api/octavia-barbican/secrets/", error: "Unable to retrieve secrets." } ]; diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js index 57519a1d..d054d58c 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js @@ -27,7 +27,7 @@ 'horizon.app.core.openstack-service-api.neutron', 'horizon.app.core.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.lbaasv2', - 'horizon.app.core.openstack-service-api.barbican', + 'horizon.app.core.openstack-service-api.octavia-barbican', 'horizon.app.core.openstack-service-api.serviceCatalog', 'horizon.framework.util.i18n.gettext' ]; @@ -45,7 +45,7 @@ * @param neutronAPI The neutron service API. * @param novaAPI The nova service API. * @param lbaasv2API The LBaaS V2 service API. - * @param barbicanAPI The barbican service API. + * @param octaviaBarbicanAPI The octavia barbican service API. * @param serviceCatalog The keystone service catalog API. * @param gettext The horizon gettext function for translation. * @returns The model service for the create load balancer workflow. @@ -56,7 +56,7 @@ neutronAPI, novaAPI, lbaasv2API, - barbicanAPI, + octaviaBarbicanAPI, serviceCatalog, gettext ) { @@ -895,8 +895,8 @@ function prepareCertificates() { return $q.all([ - barbicanAPI.getCertificates(true), - barbicanAPI.getSecrets(true) + octaviaBarbicanAPI.getCertificates(true), + octaviaBarbicanAPI.getSecrets(true) ]).then(onGetCertificates, certificatesError); } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js index e1e2e0e4..78944b7c 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js @@ -332,7 +332,7 @@ } }); - $provide.value('horizon.app.core.openstack-service-api.barbican', { + $provide.value('horizon.app.core.openstack-service-api.octavia-barbican', { getCertificates: function() { var containers = [ { diff --git a/releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml b/releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml new file mode 100644 index 00000000..900ffa72 --- /dev/null +++ b/releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixes a namespace collision with the barbican-ui dashboard.