Skip to content

Commit

Permalink
asset/machines/aws: fix num of machine objects created.
Browse files Browse the repository at this point in the history
openshift#573 had wrong calculation for machine objects
in AWS.
  • Loading branch information
abhinavdahiya committed Nov 5, 2018
1 parent 39523ae commit ea51957
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pkg/asset/machines/aws/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@ func Machines(config *types.InstallConfig, pool *types.MachinePool, role, userDa
if pool.Replicas != nil {
total = *pool.Replicas
}
numOfAZs := int64(len(azs))
var machines []clusterapi.Machine
for idx := range azs {
replicas := int32(total / numOfAZs)
if int64(idx) < total%numOfAZs {
replicas++
}

provider, err := provider(config.ClusterID, clustername, platform, mpool, idx, role, userDataSecret)
for idx := int64(0); idx < total; idx++ {
azIndex := int(idx) % len(azs)
provider, err := provider(config.ClusterID, clustername, platform, mpool, azIndex, role, userDataSecret)
if err != nil {
return nil, errors.Wrap(err, "failed to create provider")
}
Expand Down

0 comments on commit ea51957

Please sign in to comment.