@@ -1315,8 +1315,6 @@ func generateAgentPoolProfileProperties(nodeGroupInfo irs.NodeGroupInfo, subnet
1315
1315
nodeOSDiskSize = to .Int32Ptr (int32 (osDiskSize ))
1316
1316
}
1317
1317
1318
- targetZones := & []string {ac .Region .Zone }
1319
-
1320
1318
agentPoolProfileProperties := containerservice.ManagedClusterAgentPoolProfileProperties {
1321
1319
// Name: to.StringPtr(nodeGroupInfo.IId.NameId),
1322
1320
Count : to .Int32Ptr (int32 (nodeGroupInfo .DesiredNodeSize )),
@@ -1328,12 +1326,16 @@ func generateAgentPoolProfileProperties(nodeGroupInfo irs.NodeGroupInfo, subnet
1328
1326
Type : containerservice .AgentPoolTypeVirtualMachineScaleSets ,
1329
1327
MaxPods : to .Int32Ptr (maxPodCount ),
1330
1328
Mode : containerservice .AgentPoolModeSystem , // User? System?
1331
- AvailabilityZones : targetZones ,
1332
1329
EnableNodePublicIP : to .BoolPtr (true ),
1333
1330
EnableAutoScaling : to .BoolPtr (nodeGroupInfo .OnAutoScaling ),
1334
1331
// MinCount가 있으려면 true 여야함
1335
1332
VnetSubnetID : subnet .ID ,
1336
1333
}
1334
+
1335
+ if ! strings .EqualFold (ac .Region .Zone , "" ) {
1336
+ agentPoolProfileProperties .AvailabilityZones = & []string {ac .Region .Zone }
1337
+ }
1338
+
1337
1339
return agentPoolProfileProperties , nil
1338
1340
}
1339
1341
@@ -1350,8 +1352,6 @@ func generateAgentPoolProfile(nodeGroupInfo irs.NodeGroupInfo, subnet network.Su
1350
1352
nodeOSDiskSize = to .Int32Ptr (int32 (osDiskSize ))
1351
1353
}
1352
1354
1353
- targetZones := & []string {ac .Region .Zone }
1354
-
1355
1355
agentPoolProfile := containerservice.ManagedClusterAgentPoolProfile {
1356
1356
Name : to .StringPtr (nodeGroupInfo .IId .NameId ),
1357
1357
Count : to .Int32Ptr (int32 (nodeGroupInfo .DesiredNodeSize )),
@@ -1363,7 +1363,6 @@ func generateAgentPoolProfile(nodeGroupInfo irs.NodeGroupInfo, subnet network.Su
1363
1363
Type : containerservice .AgentPoolTypeVirtualMachineScaleSets ,
1364
1364
MaxPods : to .Int32Ptr (maxPodCount ),
1365
1365
Mode : containerservice .AgentPoolModeSystem , // User? System?
1366
- AvailabilityZones : targetZones ,
1367
1366
EnableNodePublicIP : to .BoolPtr (true ),
1368
1367
EnableAutoScaling : to .BoolPtr (nodeGroupInfo .OnAutoScaling ),
1369
1368
// MinCount가 있으려면 true 여야함
@@ -1373,6 +1372,11 @@ func generateAgentPoolProfile(nodeGroupInfo irs.NodeGroupInfo, subnet network.Su
1373
1372
agentPoolProfile .MinCount = nil
1374
1373
agentPoolProfile .MaxCount = nil
1375
1374
}
1375
+
1376
+ if ! strings .EqualFold (ac .Region .Zone , "" ) {
1377
+ agentPoolProfile .AvailabilityZones = & []string {ac .Region .Zone }
1378
+ }
1379
+
1376
1380
return agentPoolProfile , nil
1377
1381
}
1378
1382
0 commit comments