From ac32d6f57b68a49d8c20f5e8a3a23176ac0c3e69 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Tue, 13 Jul 2021 16:15:34 +0200 Subject: [PATCH] buildkit client does not return environment to force the caller to implement its logic in the build callback Signed-off-by: Sam Alba --- client/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index dc4d1f1d..8267849e 100644 --- a/client/client.go +++ b/client/client.go @@ -69,13 +69,13 @@ func New(ctx context.Context, host string, noCache bool) (*Client, error) { type DoFunc func(context.Context, *environment.Environment, solver.Solver) error // FIXME: return completed *Route, instead of *compiler.Value -func (c *Client) Do(ctx context.Context, state *state.State, fn DoFunc) (*environment.Environment, error) { +func (c *Client) Do(ctx context.Context, state *state.State, fn DoFunc) error { lg := log.Ctx(ctx) eg, gctx := errgroup.WithContext(ctx) environment, err := environment.New(state) if err != nil { - return nil, err + return err } // Spawn print function @@ -92,7 +92,7 @@ func (c *Client) Do(ctx context.Context, state *state.State, fn DoFunc) (*enviro return c.buildfn(gctx, state, environment, fn, events) }) - return environment, eg.Wait() + return eg.Wait() } func (c *Client) buildfn(ctx context.Context, st *state.State, env *environment.Environment, fn DoFunc, ch chan *bk.SolveStatus) error {