Skip to content

Commit 04d694f

Browse files
author
OpenShift Bot
authored
Merge pull request #1968 from jcantrill/bz1480988_fix_ops_kibana
Merged by openshift-bot
2 parents 72f8452 + bac757f commit 04d694f

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

app/scripts/directives/logViewer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ angular.module('openshiftConsole')
431431
// Kibana archives -------------------------------------------------
432432

433433
APIDiscovery
434-
.getLoggingURL()
434+
.getLoggingURL($scope.context.project)
435435
.then(function(url) {
436436
var projectName = _.get($scope.context, 'project.metadata.name');
437437
var containerName = _.get($scope.options, 'container');

app/scripts/services/discovery.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
'use strict';
22

33
angular.module('openshiftConsole')
4-
.factory('APIDiscovery', ['LOGGING_URL', 'METRICS_URL', '$q', function(LOGGING_URL, METRICS_URL, $q) {
4+
.factory('APIDiscovery', ['LOGGING_URL', 'METRICS_URL', '$q', '$filter', function(LOGGING_URL, METRICS_URL, $q, $filter) {
55
return {
66
// Simulate asynchronous requests for now. If these are ever updated to call to a discovery
77
// endpoint, we need to make sure to trigger a digest loop using (or update all callers).
8-
getLoggingURL: function() {
9-
return $q.when(LOGGING_URL);
8+
getLoggingURL: function(project) {
9+
var loggingURL = LOGGING_URL;
10+
var loggingUIHostname = $filter('annotation')(project, 'loggingUIHostname');
11+
if(loggingUIHostname) {
12+
loggingURL = 'https://' + loggingUIHostname;
13+
}
14+
15+
return $q.when(loggingURL);
1016
},
1117
getMetricsURL: function() {
1218
return $q.when(METRICS_URL);

dist/scripts/scripts.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1274,10 +1274,11 @@ loadJSON: function(t, n) {
12741274
return JSON.parse(e[t].getItem("openshift/" + n) || "{}");
12751275
}
12761276
};
1277-
} ]), angular.module("openshiftConsole").factory("APIDiscovery", [ "LOGGING_URL", "METRICS_URL", "$q", function(e, t, n) {
1277+
} ]), angular.module("openshiftConsole").factory("APIDiscovery", [ "LOGGING_URL", "METRICS_URL", "$q", "$filter", function(e, t, n, a) {
12781278
return {
1279-
getLoggingURL: function() {
1280-
return n.when(e);
1279+
getLoggingURL: function(t) {
1280+
var r = e, o = a("annotation")(t, "loggingUIHostname");
1281+
return o && (r = "https://" + o), n.when(r);
12811282
},
12821283
getMetricsURL: function() {
12831284
return n.when(t);
@@ -11338,7 +11339,7 @@ autoScrollActive: !1
1133811339
});
1133911340
});
1134011341
};
11341-
if (s.getLoggingURL().then(function(a) {
11342+
if (s.getLoggingURL(t.context.project).then(function(a) {
1134211343
var r = _.get(t.context, "project.metadata.name"), i = _.get(t.options, "container");
1134311344
r && i && C && a && (angular.extend(t, {
1134411345
kibanaAuthUrl: e.trustAsResourceUrl(URI(a).segment("auth").segment("token").normalizePathname().toString()),

0 commit comments

Comments
 (0)