Browse Source

YARN-8297. Incorrect ATS Url used for Wire encrypted cluster.(addendum). Contributed by Sunil G.

(cherry picked from commit f61e3e752eb1cf4a08030da04bc3d6c5a2b3926d)
Rohith Sharma K S 7 years ago
parent
commit
8dcc7b853b

+ 7 - 5
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js

@@ -31,7 +31,7 @@ function getYarnHttpProtocolScheme(rmhost, application) {
   $.ajax({
   $.ajax({
     type: 'GET',
     type: 'GET',
     dataType: 'json',
     dataType: 'json',
-    async: true,
+    async: false,
     context: this,
     context: this,
     url: httpUrl,
     url: httpUrl,
     success: function(data) {
     success: function(data) {
@@ -44,7 +44,7 @@ function getYarnHttpProtocolScheme(rmhost, application) {
       application.advanceReadiness();
       application.advanceReadiness();
     }
     }
   });
   });
-  return protocolScheme == "HTTPS_ONLY";
+  return protocolScheme;
 }
 }
 
 
 function getTimeLineURL(rmhost, isHttpsSchemeEnabled) {
 function getTimeLineURL(rmhost, isHttpsSchemeEnabled) {
@@ -97,7 +97,9 @@ function updateConfigs(application) {
 
 
   Ember.Logger.log("RM Address: " + rmhost);
   Ember.Logger.log("RM Address: " + rmhost);
 
 
-  var isHttpsSchemeEnabled = getYarnHttpProtocolScheme(rmhost, application);
+  var protocolSchemeFromRM = getYarnHttpProtocolScheme(rmhost, application);
+  Ember.Logger.log("Is protocol scheme https? " + (protocolSchemeFromRM == "HTTPS_ONLY"));
+  var isHttpsSchemeEnabled = (protocolSchemeFromRM == "HTTPS_ONLY");
   if(!ENV.hosts.timelineWebAddress) {
   if(!ENV.hosts.timelineWebAddress) {
     var timelinehost = "";
     var timelinehost = "";
     $.ajax({
     $.ajax({
@@ -137,7 +139,7 @@ function updateConfigs(application) {
     $.ajax({
     $.ajax({
       type: 'GET',
       type: 'GET',
       dataType: 'json',
       dataType: 'json',
-      async: true,
+      async: false,
       context: this,
       context: this,
       url: getTimeLineV1URL(rmhost, isHttpsSchemeEnabled),
       url: getTimeLineV1URL(rmhost, isHttpsSchemeEnabled),
       success: function(data) {
       success: function(data) {
@@ -171,7 +173,7 @@ function updateConfigs(application) {
     $.ajax({
     $.ajax({
       type: 'GET',
       type: 'GET',
       dataType: 'json',
       dataType: 'json',
-      async: true,
+      async: false,
       context: this,
       context: this,
       url: getSecurityURL(rmhost),
       url: getSecurityURL(rmhost),
       success: function(data) {
       success: function(data) {