mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-27 06:21:11 +01:00
fix: ignore deadline exceeded errors on bootstrap
With the recent changes, bootstrap API might wait for the time to be in sync (as the apid is launched before time is sync). We set timeout to 500ms for the bootstrap API call, so there's a chance that a call might time out, and we should ignore it. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This commit is contained in:
parent
ee06dd69fc
commit
60d7360944
@ -6,6 +6,7 @@ package cluster
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
@ -71,7 +72,12 @@ func (s *APIBootstrapper) Bootstrap(ctx context.Context, out io.Writer) error {
|
||||
defer cancel()
|
||||
|
||||
if err = cli.Bootstrap(retryCtx, &machineapi.BootstrapRequest{}); err != nil {
|
||||
if status.Code(err) == codes.FailedPrecondition || strings.Contains(err.Error(), "connection refused") {
|
||||
switch {
|
||||
case errors.Is(err, context.DeadlineExceeded):
|
||||
return retry.ExpectedError(err)
|
||||
case status.Code(err) == codes.FailedPrecondition || status.Code(err) == codes.DeadlineExceeded:
|
||||
return retry.ExpectedError(err)
|
||||
case strings.Contains(err.Error(), "connection refused"):
|
||||
return retry.ExpectedError(err)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user