@@ -350,33 +350,35 @@ func runSharding(cmd *cobra.Command, args []string) error {
350350 return nil
351351 }
352352
353- fmt .Println ("\n " + strings .Repeat ("=" , 60 ))
354- fmt .Println ("SHARDING SUMMARY" )
355- fmt .Println (strings .Repeat ("=" , 60 ))
356- if len (successfulChanges ) > 0 {
357- fmt .Printf ("Successfully changed: %d templates\n " , len (successfulChanges ))
358- for _ , ch := range successfulChanges {
359- if ch .action == "create" {
360- fmt .Printf (" ✓ Created: %s (pattern=%s, shards=%d, replicas=%d)\n " , ch .template , ch .pattern , ch .shards , ch .replicas )
361- } else {
362- fmt .Printf (" ✓ Updated: %s (pattern=%s, shards %d→%d)\n " , ch .template , ch .pattern , ch .oldShards , ch .shards )
353+ if ! dryRun {
354+ fmt .Println ("\n " + strings .Repeat ("=" , 60 ))
355+ fmt .Println ("SHARDING SUMMARY" )
356+ fmt .Println (strings .Repeat ("=" , 60 ))
357+ if len (successfulChanges ) > 0 {
358+ fmt .Printf ("Successfully changed: %d templates\n " , len (successfulChanges ))
359+ for _ , ch := range successfulChanges {
360+ if ch .action == "create" {
361+ fmt .Printf (" ✓ Created: %s (pattern=%s, shards=%d, replicas=%d)\n " , ch .template , ch .pattern , ch .shards , ch .replicas )
362+ } else {
363+ fmt .Printf (" ✓ Updated: %s (pattern=%s, shards %d→%d)\n " , ch .template , ch .pattern , ch .oldShards , ch .shards )
364+ }
363365 }
364366 }
365- }
366- if len (failedChanges ) > 0 {
367- fmt . Printf ( " \n Failed to change: %d templates \n " , len ( failedChanges ))
368- for _ , ch := range failedChanges {
369- if ch . action == " create" {
370- fmt . Printf ( " ✗ Failed to create: %s (pattern=%s) \n " , ch . template , ch . pattern )
371- } else {
372- fmt . Printf ( " ✗ Failed to update: %s (pattern=%s) \n " , ch . template , ch . pattern )
367+ if len ( failedChanges ) > 0 {
368+ fmt . Printf ( " \n Failed to change: %d templates \n " , len (failedChanges ))
369+ for _ , ch := range failedChanges {
370+ if ch . action == "create" {
371+ fmt . Printf ( " ✗ Failed to create: %s (pattern=%s) \n " , ch . template , ch . pattern )
372+ } else {
373+ fmt . Printf ( " ✗ Failed to update: %s (pattern=%s) \n " , ch . template , ch . pattern )
374+ }
373375 }
374376 }
377+ if len (successfulChanges ) == 0 && len (failedChanges ) == 0 {
378+ fmt .Println ("No templates were changed" )
379+ }
380+ fmt .Println (strings .Repeat ("=" , 60 ))
375381 }
376- if len (successfulChanges ) == 0 && len (failedChanges ) == 0 {
377- fmt .Println ("No templates were changed" )
378- }
379- fmt .Println (strings .Repeat ("=" , 60 ))
380382
381383 return nil
382384}
0 commit comments