Skip to content

Commit

Permalink
fix(google): select all zones by default when deploying a regional gc…
Browse files Browse the repository at this point in the history
…e server group (spinnaker#6751)
  • Loading branch information
Scott authored Mar 26, 2019
1 parent e5301cf commit ad2e222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ module.exports = angular
const regions = command.backingData.credentialsKeyedByAccount[command.credentials].regions;
if (_.isArray(regions)) {
filteredData.zones = _.find(regions, { name: command.region }).zones;
filteredData.truncatedZones = _.takeRight(filteredData.zones.sort(), 3);
filteredData.automaticZones = filteredData.zones.slice().sort();
} else {
// TODO(duftler): Remove this once we finish deprecating the old style regions/zones in clouddriver GCE credentials.
filteredData.zones = regions[command.region];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Server group will be available in:
</p>
<ul>
<li ng-repeat="zone in vm.command.backingData.filtered.truncatedZones">
<li ng-repeat="zone in vm.command.backingData.filtered.automaticZones">
{{zone}}
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = angular
}

function convertServerGroupCommandToDeployConfiguration(base) {
const truncatedZones = base.backingData.filtered.truncatedZones;
const automaticZones = base.backingData.filtered.automaticZones;

// use defaults to avoid copying the backingData, which is huge and expensive to copy over
const command = defaults({ backingData: [], viewState: [] }, base);
Expand All @@ -40,7 +40,7 @@ module.exports = angular
command.disableTraffic = !command.enableTraffic;
command.cloudProvider = 'gce';
command.availabilityZones = {};
command.availabilityZones[command.region] = base.zone ? [base.zone] : truncatedZones;
command.availabilityZones[command.region] = base.zone ? [base.zone] : automaticZones;
command.account = command.credentials;
delete command.viewState;
delete command.backingData;
Expand Down

0 comments on commit ad2e222

Please sign in to comment.