Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#7285 from tinyspeck/am_fix_findallshardsi…
Browse files Browse the repository at this point in the history
…nkeyspace

[vtctld] Fix accidentally-broken legacy vtctl output format
  • Loading branch information
rafael authored and ajm188 committed Jan 12, 2021
1 parent bb3c5c1 commit 86c518c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion go/vt/vtctl/vtctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,14 @@ func commandFindAllShardsInKeyspace(ctx context.Context, wr *wrangler.Wrangler,
return err
}

return printJSON(wr.Logger(), result.Shards)
// reformat data into structure of old interface
legacyShardMap := make(map[string]*topodatapb.Shard, len(result.Shards))

for _, shard := range result.Shards {
legacyShardMap[shard.Name] = shard.Shard
}

return printJSON(wr.Logger(), legacyShardMap)
}

func commandValidate(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {
Expand Down

0 comments on commit 86c518c

Please sign in to comment.