Browse Source

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
changes/10/800310/5
Michael Johnson 2 months ago
parent
commit
7e390312ea
  1. 4
      octavia_dashboard/api/rest/barbican.py
  2. 18
      octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.js
  3. 12
      octavia_dashboard/static/app/core/openstack-service-api/octavia-barbican.service.spec.js
  4. 10
      octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js
  5. 2
      octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js
  6. 4
      releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml

4
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):

18
octavia_dashboard/static/app/core/openstack-service-api/barbican.service.js → 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.'));
});

12
octavia_dashboard/static/app/core/openstack-service-api/barbican.service.spec.js → 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."
}
];

10
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);
}

2
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 = [
{

4
releasenotes/notes/Fix-namespace-collision-with-barbican-ui-267f4ba074729ea6.yaml

@ -0,0 +1,4 @@
---
fixes:
- |
Fixes a namespace collision with the barbican-ui dashboard.
Loading…
Cancel
Save