mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Add check to see if promote worked within the retry loop
This commit is contained in:
parent
f900f01725
commit
cb130042b1
@ -576,6 +576,15 @@ func (c *Client) MemberPromote(learnerID uint64) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
|
||||
defer cancel()
|
||||
|
||||
isLearner, err := c.isLearner(learnerID)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if !isLearner {
|
||||
klog.V(1).Infof("[etcd] Member %s was already promoted.", strconv.FormatUint(learnerID, 16))
|
||||
return true, nil
|
||||
}
|
||||
|
||||
_, err = cli.MemberPromote(ctx, learnerID)
|
||||
if err == nil {
|
||||
klog.V(1).Infof("[etcd] The learner was promoted as a voting member: %s", strconv.FormatUint(learnerID, 16))
|
||||
|
Loading…
Reference in New Issue
Block a user