Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topo: exit if topo info is bad #6119

Merged
merged 2 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions go/vt/topo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ func Open() *Server {
if *topoGlobalServerAddress == "" && *topoImplementation != "k8s" {
log.Exitf("topo_global_server_address must be configured")
}
if *topoGlobalRoot == "" {
log.Exit("topo_global_root must be non-empty")
}
ts, err := OpenServer(*topoImplementation, *topoGlobalServerAddress, *topoGlobalRoot)
if err != nil {
log.Exitf("Failed to open topo server (%v,%v,%v): %v", *topoImplementation, *topoGlobalServerAddress, *topoGlobalRoot, err)
Expand Down
3 changes: 3 additions & 0 deletions go/vt/vtctl/cell_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func commandAddCellInfo(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl
if err := subFlags.Parse(args); err != nil {
return err
}
if *root == "" {
return fmt.Errorf("root must be non-empty")
}
if subFlags.NArg() != 1 {
return fmt.Errorf("the <cell> argument is required for the AddCellInfo command")
}
Expand Down