Skip to content

Commit

Permalink
new fix
Browse files Browse the repository at this point in the history
  • Loading branch information
saamalik committed Jan 28, 2021
1 parent fdc0b9a commit 9851b65
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spectrocloud/resource_cluster_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ func resourceClusterVsphereUpdate(ctx context.Context, d *schema.ResourceData, m
err = c.CreateMachinePoolVsphere(cloudConfigId, machinePool)
} else if hash != resourceMachinePoolVsphereHash(oldMachinePool) {
log.Printf("Change in machine pool %s", name)
oldMachinePool := toMachinePoolVsphere(oldMachinePool)
oldPlacements := oldMachinePool.CloudConfig.Placements

// set the placement ids
for i, p := range machinePool.CloudConfig.Placements {
if len(oldPlacements) > i {
p.UID = oldPlacements[i].UID
}
}

err = c.UpdateMachinePoolVsphere(cloudConfigId, machinePool)
}

Expand Down

0 comments on commit 9851b65

Please sign in to comment.