Skip to content

Commit

Permalink
Merge pull request #4484 from jedevc/remove-with-fail-fast
Browse files Browse the repository at this point in the history
chore: remove unneccessary WithFailFast option
  • Loading branch information
AkihiroSuda authored Dec 14, 2023
2 parents 7eb8713 + e31fc48 commit a960fe5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
11 changes: 0 additions & 11 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ func New(ctx context.Context, address string, opts ...ClientOpt) (*Client, error
var creds *withCredentials

for _, o := range opts {
if _, ok := o.(*withFailFast); ok {
gopts = append(gopts, grpc.FailOnNonTempDialError(true))
}
if credInfo, ok := o.(*withCredentials); ok {
if creds == nil {
creds = &withCredentials{}
Expand Down Expand Up @@ -216,14 +213,6 @@ func (c *Client) Close() error {
return c.conn.Close()
}

type withFailFast struct{}

func (*withFailFast) isClientOpt() {}

func WithFailFast() ClientOpt {
return &withFailFast{}
}

type withDialer struct {
dialer func(context.Context, string) (net.Conn, error)
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/buildctl/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ func ResolveClient(c *cli.Context) (*client.Client, error) {
key = c.GlobalString("tlskey")
}

opts := []client.ClientOpt{client.WithFailFast()}

ctx := CommandContext(c)

var opts []client.ClientOpt
if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {
opts = append(opts, client.WithTracerProvider(span.TracerProvider()))

Expand Down
2 changes: 1 addition & 1 deletion examples/build-using-dockerfile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func action(clicontext *cli.Context) error {
if tag := clicontext.String("tag"); tag == "" {
return errors.New("tag is not specified")
}
c, err := client.New(ctx, clicontext.String("buildkit-addr"), client.WithFailFast())
c, err := client.New(ctx, clicontext.String("buildkit-addr"))
if err != nil {
return err
}
Expand Down

0 comments on commit a960fe5

Please sign in to comment.