From e05be2fd2c3cd2d610f9e2952b1eaaca62af05d9 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 15 Aug 2018 16:20:02 +0100 Subject: [PATCH] solver: Don't solve both the provided Defininiton & frontend This seems wasteful. I think there is no side-effects of the Load+Build of the definition which would make a difference to the frontend solve. Note that this changes the presedence of the actual result, previously the frontend result would overwrite the definition's one, while now the frontend would not be run. Signed-off-by: Ian Campbell --- solver/llbsolver/bridge.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solver/llbsolver/bridge.go b/solver/llbsolver/bridge.go index 2284afad..2f314a30 100644 --- a/solver/llbsolver/bridge.go +++ b/solver/llbsolver/bridge.go @@ -85,8 +85,7 @@ func (b *llbBridge) Solve(ctx context.Context, req frontend.SolveRequest) (res * } res = &frontend.Result{Ref: ref} - } - if req.Frontend != "" { + } else if req.Frontend != "" { f, ok := b.frontends[req.Frontend] if !ok { return nil, errors.Errorf("invalid frontend: %s", req.Frontend)