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 <ijc@docker.com>
docker-18.09
Ian Campbell 2018-08-15 16:20:02 +01:00
parent 785436a312
commit e05be2fd2c
1 changed files with 1 additions and 2 deletions

View File

@ -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)