From 728e3a9a7383cc6f258040c8a1fec9b84ec0a7d3 Mon Sep 17 00:00:00 2001 From: Ce Gao Date: Wed, 25 May 2022 17:30:42 +0800 Subject: [PATCH] fix: Poll instead of err (#197) Signed-off-by: Ce Gao --- cmd/envd/main.go | 2 +- pkg/buildkitd/buildkitd.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cmd/envd/main.go b/cmd/envd/main.go index 2d8616662..983990468 100644 --- a/cmd/envd/main.go +++ b/cmd/envd/main.go @@ -50,7 +50,7 @@ func run(args []string) (bool, error) { &cli.StringFlag{ Name: flag.FlagBuildkitdImage, Usage: "docker image to use for buildkitd", - Value: "docker.io/moby/buildkit:v0.10.1", + Value: "docker.io/moby/buildkit:v0.10.3", }, &cli.StringFlag{ Name: flag.FlagBuildkitdContainer, diff --git a/pkg/buildkitd/buildkitd.go b/pkg/buildkitd/buildkitd.go index 593885c67..964198660 100644 --- a/pkg/buildkitd/buildkitd.go +++ b/pkg/buildkitd/buildkitd.go @@ -109,11 +109,6 @@ func (c *generalClient) maybeStart(ctx context.Context, } } c.logger.Debug("container is running, check if it's ready...") - cli, err := client.New(ctx, c.BuildkitdAddr(), client.WithFailFast()) - if err != nil { - return "", errors.Wrap(err, "failed to create the buildkit client") - } - c.Client = cli if err := c.waitUntilConnected(ctx, runningTimeout); err != nil { return "", errors.Wrap(err, "failed to connect to buildkitd") @@ -134,8 +129,8 @@ func (c generalClient) waitUntilConnected( case <-time.After(interval): connected, err := c.connected(ctxTimeout) if err != nil { - // Has not yet started. Keep waiting. - return errors.Wrap(err, "failed to connect to buildkitd") + logrus.Debug("failed to connect to buildkitd") + continue } if !connected { continue