Commit 78e57bc9 authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Start etcd client before ensuring self removal

parent e0734425
...@@ -1372,8 +1372,17 @@ func (e *ETCD) GetMembersNames(ctx context.Context) ([]string, error) { ...@@ -1372,8 +1372,17 @@ func (e *ETCD) GetMembersNames(ctx context.Context) ([]string, error) {
return memberNames, nil return memberNames, nil
} }
// RemoveSelf will remove the member if it exists in the cluster // RemoveSelf will remove the member if it exists in the cluster. This should
// only be called on a node that may have previously run etcd, but will not
// currently run etcd, to ensure that it is not a member of the cluster.
// This is also called by tests to do cleanup between runs.
func (e *ETCD) RemoveSelf(ctx context.Context) error { func (e *ETCD) RemoveSelf(ctx context.Context) error {
if e.client == nil {
if err := e.startClient(ctx); err != nil {
return err
}
}
if err := e.RemovePeer(ctx, e.name, e.address, true); err != nil { if err := e.RemovePeer(ctx, e.name, e.address, true); err != nil {
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment