@@ -1399,14 +1399,14 @@ func TestAccAdvancedCluster_removeBlocksFromConfig(t *testing.T) {
1399
1399
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
1400
1400
Steps : []resource.TestStep {
1401
1401
{
1402
- Config : configBlocks (t , projectID , clusterName , "M10" , true ),
1403
- Check : checkBlocks ("M10" ),
1402
+ Config : configBlocks (t , projectID , clusterName , 3 , true ),
1403
+ Check : checkBlocks (3 ),
1404
1404
},
1405
1405
// removing blocks generates an empty plan
1406
- acc .TestStepCheckEmptyPlan (configBlocks (t , projectID , clusterName , "M10" , false )),
1406
+ acc .TestStepCheckEmptyPlan (configBlocks (t , projectID , clusterName , 3 , false )),
1407
1407
{
1408
- Config : configBlocks (t , projectID , clusterName , "M20" , false ), // applying a change after removing blocks preserves previous state
1409
- Check : checkBlocks ("M20" ),
1408
+ Config : configBlocks (t , projectID , clusterName , 5 , false ), // applying a change after removing blocks preserves previous state
1409
+ Check : checkBlocks (5 ),
1410
1410
},
1411
1411
acc .TestStepImportCluster (resourceName ),
1412
1412
},
@@ -1506,7 +1506,7 @@ func configSharded(t *testing.T, projectID, clusterName string, withUpdate bool)
1506
1506
` , projectID , clusterName , autoScaling , analyticsSpecs , analyticsSpecsForSpec2 )) + dataSourcesTFNewSchema
1507
1507
}
1508
1508
1509
- func configBlocks (t * testing.T , projectID , clusterName , instanceSize string , defineBlocks bool ) string {
1509
+ func configBlocks (t * testing.T , projectID , clusterName string , nodeCount int , defineBlocks bool ) string {
1510
1510
t .Helper ()
1511
1511
var extraConfig0 , extraConfig1 string
1512
1512
autoScalingBlocks := `
@@ -1572,8 +1572,8 @@ func configBlocks(t *testing.T, projectID, clusterName, instanceSize string, def
1572
1572
priority = 7
1573
1573
region_name = "US_WEST_2"
1574
1574
electable_specs {
1575
- instance_size = %[3]q
1576
- node_count = 3
1575
+ instance_size = "M10"
1576
+ node_count = %[3]d
1577
1577
}
1578
1578
%[5]s
1579
1579
}
@@ -1585,20 +1585,20 @@ func configBlocks(t *testing.T, projectID, clusterName, instanceSize string, def
1585
1585
}
1586
1586
}
1587
1587
}
1588
- ` , projectID , clusterName , instanceSize , extraConfig0 , extraConfig1 ))
1588
+ ` , projectID , clusterName , nodeCount , extraConfig0 , extraConfig1 ))
1589
1589
}
1590
1590
1591
- func checkBlocks (instanceSize string ) resource.TestCheckFunc {
1591
+ func checkBlocks (nodeCount int ) resource.TestCheckFunc {
1592
1592
checksMap := map [string ]string {
1593
1593
"replication_specs.0.region_configs.0.electable_specs.0.instance_size" : "M10" ,
1594
1594
"replication_specs.0.region_configs.0.electable_specs.0.node_count" : "5" ,
1595
1595
"replication_specs.0.region_configs.0.read_only_specs.0.instance_size" : "M10" ,
1596
1596
"replication_specs.0.region_configs.0.read_only_specs.0.node_count" : "2" ,
1597
1597
"replication_specs.0.region_configs.0.analytics_specs.0.node_count" : "0" ,
1598
1598
1599
- "replication_specs.1.region_configs.0.electable_specs.0.instance_size" : instanceSize ,
1600
- "replication_specs.1.region_configs.0.electable_specs.0.node_count" : "3" ,
1601
- "replication_specs.1.region_configs.0.read_only_specs.0.instance_size" : instanceSize ,
1599
+ "replication_specs.1.region_configs.0.electable_specs.0.instance_size" : "M10" ,
1600
+ "replication_specs.1.region_configs.0.electable_specs.0.node_count" : fmt . Sprintf ( "%d" , nodeCount ) ,
1601
+ "replication_specs.1.region_configs.0.read_only_specs.0.instance_size" : "M10" ,
1602
1602
"replication_specs.1.region_configs.0.read_only_specs.0.node_count" : "1" ,
1603
1603
"replication_specs.1.region_configs.0.analytics_specs.0.instance_size" : "M10" ,
1604
1604
"replication_specs.1.region_configs.0.analytics_specs.0.node_count" : "4" ,
0 commit comments