Skip to content

Commit

Permalink
fix(amazon): Disallow enable instance in a disabled server group (#7197)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmquach committed Jul 8, 2019
1 parent e3f2b8d commit 7a218bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = angular

function retrieveInstance() {
var extraData = {};
var instanceSummary, loadBalancers, targetGroups, account, region, vpcId;
var instanceSummary, loadBalancers, targetGroups, account, region, vpcId, serverGroupDisabled;
if (!app.serverGroups) {
// standalone instance
instanceSummary = { id: instance.instanceId }; // terminate call expects `id` to be populated
Expand All @@ -104,6 +104,7 @@ module.exports = angular
account = serverGroup.account;
region = serverGroup.region;
vpcId = serverGroup.vpcId;
serverGroupDisabled = serverGroup.isDisabled;
extraData.serverGroup = serverGroup.name;
extraData.vpcId = serverGroup.vpcId;
return true;
Expand Down Expand Up @@ -194,6 +195,7 @@ module.exports = angular
$scope.instance.account = account;
$scope.instance.region = region;
$scope.instance.vpcId = vpcId;
$scope.instance.serverGroupDisabled = serverGroupDisabled;
$scope.instance.loadBalancers = loadBalancers;
$scope.instance.targetGroups = targetGroups;
if ($scope.instance.networkInterfaces) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ <h3 class="horizontal middle space-between flex-1" select-on-dbl-click>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li>
<a href ng-click="ctrl.enableInstanceInDiscovery()" ng-if="ctrl.canRegisterWithDiscovery()"
<a
href
ng-click="ctrl.enableInstanceInDiscovery()"
ng-if="ctrl.canRegisterWithDiscovery() && !instance.serverGroupDisabled"
>Enable in Discovery</a
>
</li>
Expand Down

0 comments on commit 7a218bc

Please sign in to comment.