@@ -280,36 +280,32 @@ func confirmInstallClusterConfig(clusterConfig *clusterconfig.Config, awsClient
280
280
281
281
func confirmConfigureClusterConfig (configureChanges clusterconfig.ConfigureChanges , oldCc , newCc clusterconfig.Config , disallowPrompt bool ) {
282
282
fmt .Printf ("your %s cluster in region %s will be updated as follows:\n \n " , newCc .ClusterName , newCc .Region )
283
- if len (configureChanges .NodeGroupsToScale ) > 0 {
284
- fmt .Printf ("○ %d %s will be scaled\n " , len (configureChanges .NodeGroupsToScale ), s .PluralS ("nodegroup" , len (configureChanges .NodeGroupsToScale )))
285
- for _ , ngName := range configureChanges .NodeGroupsToScale {
286
- var output string
287
- ngOld := oldCc .GetNodeGroupByName (ngName )
288
- ngScaled := newCc .GetNodeGroupByName (ngName )
289
- if ngOld .MinInstances != ngScaled .MinInstances && ngOld .MaxInstances != ngScaled .MaxInstances {
290
- output = fmt .Sprintf ("nodegroup %s will update its %s from %d to %d and update its %s from %d to %d" , ngName , clusterconfig .MinInstancesKey , ngOld .MinInstances , ngScaled .MinInstances , clusterconfig .MaxInstancesKey , ngOld .MaxInstances , ngScaled .MaxInstances )
291
- }
292
- if ngOld .MinInstances == ngScaled .MinInstances && ngOld .MaxInstances != ngScaled .MaxInstances {
293
- output = fmt .Sprintf ("nodegroup %s will update its %s from %d to %d" , ngName , clusterconfig .MaxInstancesKey , ngOld .MaxInstances , ngScaled .MaxInstances )
294
- }
295
- if ngOld .MinInstances != ngScaled .MinInstances && ngOld .MaxInstances == ngScaled .MaxInstances {
296
- output = fmt .Sprintf ("nodegroup %s will update its %s from %d to %d" , ngName , clusterconfig .MinInstancesKey , ngOld .MinInstances , ngScaled .MinInstances )
297
- }
298
- fmt .Printf (" ○ %s\n " , output )
283
+
284
+ for _ , ngName := range configureChanges .NodeGroupsToScale {
285
+ ngOld := oldCc .GetNodeGroupByName (ngName )
286
+ ngScaled := newCc .GetNodeGroupByName (ngName )
287
+ if ngOld .MinInstances != ngScaled .MinInstances && ngOld .MaxInstances != ngScaled .MaxInstances {
288
+ fmt .Printf ("○ nodegroup %s will update %s from %d to %d and %s from %d to %d\n " , ngName , clusterconfig .MinInstancesKey , ngOld .MinInstances , ngScaled .MinInstances , clusterconfig .MaxInstancesKey , ngOld .MaxInstances , ngScaled .MaxInstances )
289
+ } else if ngOld .MinInstances == ngScaled .MinInstances && ngOld .MaxInstances != ngScaled .MaxInstances {
290
+ fmt .Printf ("○ nodegroup %s will update %s from %d to %d\n " , ngName , clusterconfig .MaxInstancesKey , ngOld .MaxInstances , ngScaled .MaxInstances )
291
+ } else if ngOld .MinInstances != ngScaled .MinInstances && ngOld .MaxInstances == ngScaled .MaxInstances {
292
+ fmt .Printf ("○ nodegroup %s will update %s from %d to %d\n " , ngName , clusterconfig .MinInstancesKey , ngOld .MinInstances , ngScaled .MinInstances )
299
293
}
300
294
}
301
- if len (configureChanges .NodeGroupsToAdd ) > 0 {
302
- fmt .Printf ("○ %d %s will be added: %s\n " , len (configureChanges .NodeGroupsToAdd ), s .PluralS ("nodegroup" , len (configureChanges .NodeGroupsToAdd )), s .StrsAnd (configureChanges .NodeGroupsToAdd ))
295
+
296
+ for _ , ngName := range configureChanges .NodeGroupsToAdd {
297
+ fmt .Printf ("○ nodegroup %s will be added\n " , ngName )
303
298
}
304
- if len (configureChanges .NodeGroupsToRemove ) > 0 {
305
- fmt .Printf ("○ %d %s will be removed: %s\n " , len (configureChanges .NodeGroupsToRemove ), s .PluralS ("nodegroup" , len (configureChanges .NodeGroupsToRemove )), s .StrsAnd (configureChanges .NodeGroupsToRemove ))
299
+
300
+ for _ , ngName := range configureChanges .NodeGroupsToRemove {
301
+ fmt .Printf ("○ nodegroup %s will be removed\n " , ngName )
306
302
}
307
- // EKS node groups that don't appear in the old/new cluster config
308
- // this is unlikely but can happen
309
- ghostEKSNodeGroups := configureChanges .GetGhostEKSNodeGroups ()
310
- if len (ghostEKSNodeGroups ) > 0 {
311
- fmt .Printf ("○ %d %s will be removed: %s\n " , len (ghostEKSNodeGroups ), s .PluralS ("EKS nodegroup" , len (ghostEKSNodeGroups )), s .StrsAnd (ghostEKSNodeGroups ))
303
+
304
+ // EKS node groups that don't appear in the old/new cluster config; this is unlikely but can happen
305
+ for _ , ngName := range configureChanges .GetGhostEKSNodeGroups () {
306
+ fmt .Printf ("○ EKS nodegroup %s will be removed\n " , ngName )
312
307
}
308
+
313
309
fmt .Println ()
314
310
315
311
if ! disallowPrompt {
0 commit comments