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

vtctld: make cell optional #6111

Merged
merged 2 commits into from
Apr 27, 2020
Merged
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
12 changes: 10 additions & 2 deletions go/vt/vtctld/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,17 @@ func initAPI(ctx context.Context, ts *topo.Server, actions *ActionRepository, re

if cell == "local" {
if *localCell == "" {
return nil, fmt.Errorf("local cell requested, but not specified. Please set with -cell flag")
cells, err := ts.GetCellInfoNames(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that local is a reserved cell name and no one can use it for their cells? We need to document that.

if err != nil {
return nil, fmt.Errorf("could not fetch cell info: %v", err)
}
if len(cells) == 0 {
return nil, fmt.Errorf("no local cells have been created yet")
}
cell = cells[0]
} else {
cell = *localCell
}
cell = *localCell
}

// If a keyspace is provided then return the specified srvkeyspace.
Expand Down