Skip to content

Commit

Permalink
Merge pull request #173 from aidenkeating/master
Browse files Browse the repository at this point in the history
ensure duplicate azs are never used
  • Loading branch information
openshift-merge-robot authored Aug 10, 2020
2 parents 8619efe + 38295d4 commit e0aa346
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/providers/aws/cluster_network_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1041,14 +1041,19 @@ func (n *NetworkProvider) reconcileStandaloneVPCSubnets(ctx context.Context, log
}

// filter the availability zones to only include ones that support the default instance types.
// ensure if any duplicate regions are returned, they are removed.
var supportedAzs []*ec2.AvailabilityZone
for _, az := range azs.AvailabilityZones {
foundAz := false
for _, instanceTypeOffering := range describeInstanceTypeOfferingsOutput.InstanceTypeOfferings {
if aws.StringValue(instanceTypeOffering.Location) == aws.StringValue(az.ZoneName) {
supportedAzs = append(supportedAzs, az)
continue
foundAz = true
break
}
}
if foundAz {
supportedAzs = append(supportedAzs, az)
}
}

// sort the azs first
Expand Down

0 comments on commit e0aa346

Please sign in to comment.