kubeadm: do not add learner member to etcd client endpoints

This commit is contained in:
Paco Xu
2026-02-26 10:16:51 +08:00
committed by Benjamin Wang
parent d5a491b925
commit 67f0efebf1

View File

@@ -533,8 +533,10 @@ func (c *Client) addMember(name string, peerAddrs string, isLearner bool) ([]Mem
ret = append(ret, Member{Name: memberName, PeerURL: m.PeerURLs[0]})
}
// Add the new member client address to the list of endpoints
c.Endpoints = append(c.Endpoints, GetClientURLByIP(parsedPeerAddrs.Hostname()))
if !isLearner {
// Add the new member client address to the list of endpoints
c.Endpoints = append(c.Endpoints, GetClientURLByIP(parsedPeerAddrs.Hostname()))
}
return ret, nil
}