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

add 'keyspace exist' check when ApplyVschema #5931

Merged

Conversation

inolddays
Copy link
Contributor

@inolddays inolddays commented Mar 17, 2020

Should also fix #5867

Signed-off-by: JohnnyThree whereshallyoube@gmail.com

@inolddays inolddays requested a review from sougou as a code owner March 17, 2020 10:48
@@ -2553,6 +2553,13 @@ func commandApplyVSchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *f
return nil
}

if _, err := wr.TopoServer().GetKeyspace(ctx, keyspace); err != nil {
if strings.Contains(err.Error(), "node doesn't exist") {
return fmt.Errorf("keyspace(%s) doesn't exist, check if the keyspace is initialed.\n", keyspace)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: s/initialed/initialized/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected

Signed-off-by: JohnnyThree <whereshallyoube@gmail.com>
@inolddays inolddays force-pushed the checkkeyspaceifexistwhenapplyvschema branch from b2f438e to 7224d44 Compare March 17, 2020 14:58
@deepthi deepthi changed the title add 'keyspace exist' check when ApplyVshcema add 'keyspace exist' check when ApplyVschema Mar 17, 2020
@morgo morgo self-requested a review March 19, 2020 14:38
Copy link
Contributor

@morgo morgo left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Applying VSchema referencing missing keyspace hides all keyspaces from UI
3 participants