-
Notifications
You must be signed in to change notification settings - Fork 595
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
Make ForceLeave and RemoveFailedNode fail when node doesn't exist #504
Conversation
In this PR I changed |
I added the check to |
The build failure should be unrelated. I ran it successfully on my machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @i0rek this looks good, just one small comment and then I think we can merge.
} | ||
|
||
code := c.Run(args) | ||
if code != 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you check the output of ui.ErrorWriter.String()
and make sure it has the 'node not found' text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
ping @kyhavlov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @i0rek and @grounded042 for fixes here. Apologies it's been so long to get approved.
3381f8d
to
c4f944a
Compare
This PR fixes #500 and hashicorp/consul#3757. I added a test and mentioned the return code in the docs since it changes the CLI return codes.
I notices a couple of things during implementing and testing the changes:
RemoveFailedNode
, consul's CLI is changing as well. Before it returned 0, now it returns 1 if you try to remove a node that doesn't exist.Before:
After:
force-leave
itself