Commit 973084ce authored by galal-hussein's avatar galal-hussein Committed by Brad Davidson

Update peer address when running cluster-reset

parent f07ee54d
...@@ -189,8 +189,24 @@ func (e *ETCD) Reset(ctx context.Context, rebootstrap func() error) error { ...@@ -189,8 +189,24 @@ func (e *ETCD) Reset(ctx context.Context, rebootstrap func() error) error {
logrus.Infof("Etcd is running, restart without --cluster-reset flag now. Backup and delete ${datadir}/server/db on each peer etcd server and rejoin the nodes") logrus.Infof("Etcd is running, restart without --cluster-reset flag now. Backup and delete ${datadir}/server/db on each peer etcd server and rejoin the nodes")
os.Exit(0) os.Exit(0)
} }
} else {
// make sure that peer ips are updated to the node ip in case the test fails
members, err := e.client.MemberList(ctx)
if err != nil {
logrus.Warnf("failed to list etcd members: %v", err)
continue
}
if len(members.Members) > 1 {
logrus.Warnf("failed to update peer url: etcd still has more than one member")
continue
}
if _, err := e.client.MemberUpdate(ctx, members.Members[0].ID, []string{e.peerURL()}); err != nil {
logrus.Warnf("failed to update peer url: %v", err)
continue
} }
} }
}
}() }()
// If asked to restore from a snapshot, do so // If asked to restore from a snapshot, do so
......
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