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

Signed-off-by: Andrew Mason <amason@slack-corp.com>
  • Loading branch information
rafael authored and ajm188 committed Jan 13, 2021
1 parent d86632c commit 7c7ea05
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 @@ -2561,7 +2561,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 7c7ea05

Please sign in to comment.