Skip to content

Commit

Permalink
sort on masters
Browse files Browse the repository at this point in the history
  • Loading branch information
saamalik committed Mar 2, 2021
1 parent 67785c5 commit c67ce9e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spectrocloud/resource_cluster_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package spectrocloud
import (
"context"
"log"
"sort"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -496,6 +497,11 @@ func toVsphereCluster(d *schema.ResourceData) *models.V1alpha1SpectroVsphereClus
machinePoolConfigs = append(machinePoolConfigs, mp)
}

// sort
sort.SliceStable(machinePoolConfigs, func(i, j int) bool {
return machinePoolConfigs[i].PoolConfig.IsControlPlane
})

cluster.Spec.Machinepoolconfig = machinePoolConfigs

packValues := make([]*models.V1alpha1PackValuesEntity, 0)
Expand Down

0 comments on commit c67ce9e

Please sign in to comment.