From 479419abf234c87f00f042db0403d41522727b58 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 7 Jun 2018 13:54:04 -0700 Subject: [PATCH] =?UTF-8?q?llbsolver:=20don=E2=80=99t=20error=20on=20reado?= =?UTF-8?q?nly=20scratch=20mount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tonis Tiigi --- client/client_test.go | 3 +-- solver/llbsolver/ops/exec.go | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index 66a21283..b59ae1ba 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -893,8 +893,7 @@ func testMountWithNoSource(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) _, err = c.Solve(context.TODO(), def, SolveOpt{}, nil) - require.Error(t, err) - require.Contains(t, err.Error(), "has no input") + require.NoError(t, err) checkAllReleasable(t, c, sb, true) } diff --git a/solver/llbsolver/ops/exec.go b/solver/llbsolver/ops/exec.go index 6ef6704f..3cae012f 100644 --- a/solver/llbsolver/ops/exec.go +++ b/solver/llbsolver/ops/exec.go @@ -262,7 +262,16 @@ func (e *execOp) Exec(ctx context.Context, inputs []solver.Result) ([]solver.Res outputs = append(outputs, active) mountable = active } + } else if ref == nil { + // this case is empty readonly scratch without output that is not really useful for anything but don't error + active, err := makeMutable(ref) + if err != nil { + return nil, err + } + defer active.Release(context.TODO()) + mountable = active } + case pb.MountType_CACHE: if m.CacheOpt == nil { return nil, errors.Errorf("missing cache mount options")