Skip to content

Commit c0a839c

Browse files
committed
chore: translateLegacySolveRequest does not need to return error checking.
Signed-off-by: joey <[email protected]>
1 parent 2a0dd4b commit c0a839c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

control/control.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func (c *Controller) UpdateBuildHistory(ctx context.Context, req *controlapi.Upd
276276
return &controlapi.UpdateBuildHistoryResponse{}, err
277277
}
278278

279-
func translateLegacySolveRequest(req *controlapi.SolveRequest) error {
279+
func translateLegacySolveRequest(req *controlapi.SolveRequest) {
280280
// translates ExportRef and ExportAttrs to new Exports (v0.4.0)
281281
if legacyExportRef := req.Cache.ExportRefDeprecated; legacyExportRef != "" {
282282
ex := &controlapi.CacheOptionsEntry{
@@ -302,18 +302,13 @@ func translateLegacySolveRequest(req *controlapi.SolveRequest) error {
302302
req.Cache.Imports = append(req.Cache.Imports, im)
303303
}
304304
req.Cache.ImportRefsDeprecated = nil
305-
return nil
306305
}
307306

308307
func (c *Controller) Solve(ctx context.Context, req *controlapi.SolveRequest) (*controlapi.SolveResponse, error) {
309308
atomic.AddInt64(&c.buildCount, 1)
310309
defer atomic.AddInt64(&c.buildCount, -1)
311310

312-
// This method registers job ID in solver.Solve. Make sure there are no blocking calls before that might delay this.
313-
314-
if err := translateLegacySolveRequest(req); err != nil {
315-
return nil, err
316-
}
311+
translateLegacySolveRequest(req)
317312

318313
defer func() {
319314
time.AfterFunc(time.Second, c.throttledGC)

0 commit comments

Comments
 (0)