Fix etcd join timeout handling

Error is deadline exceeded, not cancelled

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2025-08-27 17:26:29 +00:00 committed by Brad Davidson
parent 795091a809
commit f1c82392d0

View file

@ -626,7 +626,7 @@ func (e *ETCD) join(ctx context.Context, clientAccessInfo *clientaccess.Info) er
if add {
logrus.Infof("Adding member %s=%s to etcd cluster %v", e.name, e.peerURL(), cluster)
if _, err = client.MemberAddAsLearner(clientCtx, []string{e.peerURL()}); err != nil {
if errors.Is(err, context.Canceled) {
if errors.Is(err, context.DeadlineExceeded) {
return ErrJoinTimeout
}
return err