chore: wait for FailedPrecondition in addition to Unavailable for backward compatibility

This commit is contained in:
Pasha Sviderski
2025-12-23 19:48:18 +10:00
parent 5308c87651
commit f6cf73190f
+3 -1
View File
@@ -134,7 +134,9 @@ func (cli *Client) WaitClusterReady(ctx context.Context, timeout time.Duration)
listMachines := func() error { listMachines := func() error {
_, err := cli.ListMachines(ctx, nil) _, err := cli.ListMachines(ctx, nil)
if err != nil { if err != nil {
if s, ok := status.FromError(err); ok && s.Code() == codes.Unavailable { if s, ok := status.FromError(err); ok &&
// TODO: remove FailedPrecondition after releading 0.17.
(s.Code() == codes.Unavailable || s.Code() == codes.FailedPrecondition) {
// Machine is not ready yet, retry. // Machine is not ready yet, retry.
return err return err
} }