From c9b01072d01c9e6db9c9af16d257004aaaf01885 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Fri, 5 Oct 2018 22:50:07 +0000 Subject: [PATCH] solver: specify SSH key ID in error message when required key was not forwarded Signed-off-by: Tibor Vass --- client/client_test.go | 2 +- solver/llbsolver/ops/exec.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index d832362e..6942c01b 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -157,7 +157,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { _, err = c.Solve(context.TODO(), def, SolveOpt{}, nil) require.Error(t, err) - require.Contains(t, err.Error(), "no ssh forwarded from the client") + require.Contains(t, err.Error(), "no SSH key ") // custom ID not exposed st = llb.Image("busybox:latest").Run(llb.Shlex(`nosuchcmd`), llb.AddSSHSocket(llb.SSHID("customID"))) diff --git a/solver/llbsolver/ops/exec.go b/solver/llbsolver/ops/exec.go index e9187245..9eb9968a 100644 --- a/solver/llbsolver/ops/exec.go +++ b/solver/llbsolver/ops/exec.go @@ -302,7 +302,7 @@ func (e *execOp) getSSHMountable(ctx context.Context, m *pb.Mount) (cache.Mounta return nil, nil } if st, ok := status.FromError(err); ok && st.Code() == codes.Unimplemented { - return nil, errors.Errorf("no ssh forwarded from the client") + return nil, errors.Errorf("no SSH key %q forwarded from the client", m.SSHOpt.ID) } return nil, err }