Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: a-palchikov <deemok@gmail.com>
  • Loading branch information
a-palchikov committed May 29, 2023
1 parent 7c390df commit ae8e22d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
32 changes: 12 additions & 20 deletions client/solve.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
supportFile = ex.Output != nil
}
if supportFile && supportDir {
return nil, errors.Errorf("both file and directory output is not support by %s exporter", ex.Type)
return nil, errors.Errorf("both file and directory output is not supported by %s exporter", ex.Type)
}
if !supportFile && ex.Output != nil {
return nil, errors.Errorf("output file writer is not supported by %s exporter", ex.Type)
Expand Down Expand Up @@ -305,26 +305,18 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
exports = append(exports, localExporter)
}

// For older server, use the first exporter
var ex ExportEntry
if len(opt.Exports) != 0 {
ex = opt.Exports[0]
}

resp, err := c.ControlClient().Solve(ctx, &controlapi.SolveRequest{
Ref: ref,
Definition: pbd,
ExporterDeprecated: ex.Type,
ExporterAttrsDeprecated: ex.Attrs,
Exporters: exports,
Session: s.ID(),
Frontend: opt.Frontend,
FrontendAttrs: frontendAttrs,
FrontendInputs: frontendInputs,
Cache: cacheOpt.options,
Entitlements: opt.AllowedEntitlements,
Internal: opt.Internal,
SourcePolicy: opt.SourcePolicy,
Ref: ref,
Definition: pbd,
Exporters: exports,
Session: s.ID(),
Frontend: opt.Frontend,
FrontendAttrs: frontendAttrs,
FrontendInputs: frontendInputs,
Cache: cacheOpt.options,
Entitlements: opt.AllowedEntitlements,
Internal: opt.Internal,
SourcePolicy: opt.SourcePolicy,
})
if err != nil {
return errors.Wrap(err, "failed to solve")
Expand Down
2 changes: 0 additions & 2 deletions solver/result/result.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package result

import (
"sync"

"github.com/pkg/errors"
)

Expand Down

0 comments on commit ae8e22d

Please sign in to comment.