mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@cbfd4023383d
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
24
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
24
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
@ -8,6 +8,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
contentapi "github.com/containerd/containerd/api/services/content/v1"
|
||||
"github.com/containerd/containerd/defaults"
|
||||
@ -186,16 +187,29 @@ func (c *Client) Dialer() session.Dialer {
|
||||
}
|
||||
|
||||
func (c *Client) Wait(ctx context.Context) error {
|
||||
opts := []grpc.CallOption{grpc.WaitForReady(true)}
|
||||
_, err := c.ControlClient().Info(ctx, &controlapi.InfoRequest{}, opts...)
|
||||
if err != nil {
|
||||
if code := grpcerrors.Code(err); code == codes.Unimplemented {
|
||||
for {
|
||||
_, err := c.ControlClient().Info(ctx, &controlapi.InfoRequest{})
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch code := grpcerrors.Code(err); code {
|
||||
case codes.Unavailable:
|
||||
case codes.Unimplemented:
|
||||
// only buildkit v0.11+ supports the info api, but an unimplemented
|
||||
// response error is still a response so we can ignore it
|
||||
return nil
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
case <-time.After(time.Second):
|
||||
}
|
||||
c.conn.ResetConnectBackoff()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Client) Close() error {
|
||||
|
Reference in New Issue
Block a user