Skip to content

Commit

Permalink
fix(provider/openstack): load balancer network and sg creation bugfix…
Browse files Browse the repository at this point in the history
…es (#4281)

fix(provider/openstack): Fixed network so it is filtered by account for load balancer creation.
fix(provider/openstack): Fixed network so it refreshes when a new account is selected.
fix(provider/openstack): Fixed network so it resets to default when a new account is selected and the selected network becomes invalid.
fix(provider/openstack): Fixed security groups so it clears and refreshes when a new account is selected.
fix(provider/openstack): Fixed security groups refresh button.
fix(provider/openstack): Removed security group refresh tooltip that wasn't showing any data.
  • Loading branch information
dylanbernhardt authored and edwinavalos committed Oct 17, 2017
1 parent f2bb3f8 commit e0cce40
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ui-select>
</div>
<div class="col-md-1 sm-label-left">
<a href="" ng-click="forceRefreshCache()" uib-tooltip-template="refreshTooltipTemplate">
<a href="" ng-click="forceRefreshCache()">
<span class="fa fa-refresh" ng-class="{'fa-spin':cache.loading}"></span>
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<ng-form class="container-fluid form-horizontal" name="interfaceForm">
<div class="modal-body">
<network-select-field model="loadBalancer.networkId" help-key="openstack.loadBalancer.network" read-only="!isNew"></network-select-field>
<network-select-field
model="loadBalancer.networkId"
help-key="openstack.loadBalancer.network"
read-only="!isNew"
filter="{ account: loadBalancer.account }">
</network-select-field>

<os-cache-backed-multi-select-field label="Security Groups"
cache="allSecurityGroups"
refresh-cache="updateSecurityGroups"
required="true"
model="loadBalancer.securityGroups"></os-cache-backed-multi-select-field>
<os-cache-backed-multi-select-field
label="Security Groups"
cache="allSecurityGroups"
refresh-cache="updateSecurityGroups"
required="true"
model="loadBalancer.securityGroups">
</os-cache-backed-multi-select-field>
</div>
</ng-form>
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = angular.module('spinnaker.loadBalancer.openstack.create.control
$scope.allSecurityGroups = [];
$scope.$watch('loadBalancer.account', updateSecurityGroups);
$scope.$watch('loadBalancer.region', updateSecurityGroups);
$scope.updateSecurityGroups = updateSecurityGroups;
updateSecurityGroups();

// initialize controller
Expand Down Expand Up @@ -158,6 +159,9 @@ module.exports = angular.module('spinnaker.loadBalancer.openstack.create.control
this.accountUpdated = function() {
ctrl.updateName();
$scope.subnetFilter = {type: 'openstack', account: $scope.loadBalancer.account, region: $scope.loadBalancer.region};
if ($scope.loadBalancer) {
$scope.loadBalancer.securityGroups = [];
}
updateLoadBalancerNames();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ module.exports = angular.module('spinnaker.openstack.network.networkSelectField.
scope.onChange({network: newValue});
}
}

});

scope.$watch('filter', function() { scope.$broadcast('updateOptions'); });
scope.$watch('filter', function() {
scope.$broadcast('onValueChanged');
scope.updateOptions();
});
}
};
});

0 comments on commit e0cce40

Please sign in to comment.