Prechádzať zdrojové kódy

AMBARI-9131 Allow operations during RU via "experimental". (ababiichuk)

aBabiichuk 10 rokov pred
rodič
commit
9cea058fb1

+ 1 - 1
ambari-web/app/app.js

@@ -76,7 +76,7 @@ module.exports = Em.Application.create({
    * @return {boolean}
    */
   isAccessible: function (type) {
-    if (this.get('upgradeState') !== 'INIT' && !type.contains('upgrade_')) {
+    if (!App.get('supports.opsDuringRollingUpgrade') && this.get('upgradeState') !== 'INIT' && !type.contains('upgrade_')) {
       return false;
     }
 

+ 2 - 1
ambari-web/app/config.js

@@ -65,7 +65,8 @@ App.supports = {
   preKerberizeCheck: false,
   automatedKerberos: true,
   customizeAgentUserAccount: false,
-  installGanglia: false
+  installGanglia: false,
+  opsDuringRollingUpgrade: false
 };
 
 if (App.enableExperimental) {

+ 7 - 0
ambari-web/test/app_test.js

@@ -409,6 +409,13 @@ describe('App', function () {
       App.set('isAdmin', true);
       expect(App.isAccessible('upgrade_ADMIN')).to.be.true;
     });
+    it("Upgrade running, upgrade element should not be blocked", function() {
+      App.set('upgradeState', "IN_PROGRESS");
+      App.set('isAdmin', true);
+      App.set('supports.opsDuringRollingUpgrade', true);
+      expect(App.isAccessible('ADMIN')).to.be.true;
+      App.set('supports.opsDuringRollingUpgrade', false);
+    });
     it("ADMIN type, isAdmin true", function() {
       App.set('upgradeState', "INIT");
       App.set('isAdmin', true);