@@ -26,8 +26,8 @@ import (
26
26
"golang.org/x/sync/errgroup"
27
27
)
28
28
29
- func LLBBridgeToGatewayClient (ctx context.Context , llbBridge frontend.FrontendLLBBridge , opts map [string ]string , inputs map [string ]* opspb.Definition , w worker.Infos , sid string , sm * session.Manager ) (* bridgeClient , error ) {
30
- bc := & bridgeClient {
29
+ func LLBBridgeToGatewayClient (ctx context.Context , llbBridge frontend.FrontendLLBBridge , opts map [string ]string , inputs map [string ]* opspb.Definition , w worker.Infos , sid string , sm * session.Manager ) (* BridgeClient , error ) {
30
+ bc := & BridgeClient {
31
31
opts : opts ,
32
32
inputs : inputs ,
33
33
FrontendLLBBridge : llbBridge ,
@@ -40,7 +40,7 @@ func LLBBridgeToGatewayClient(ctx context.Context, llbBridge frontend.FrontendLL
40
40
return bc , nil
41
41
}
42
42
43
- type bridgeClient struct {
43
+ type BridgeClient struct {
44
44
frontend.FrontendLLBBridge
45
45
mu sync.Mutex
46
46
opts map [string ]string
@@ -54,7 +54,7 @@ type bridgeClient struct {
54
54
ctrs []client.Container
55
55
}
56
56
57
- func (c * bridgeClient ) Solve (ctx context.Context , req client.SolveRequest ) (* client.Result , error ) {
57
+ func (c * BridgeClient ) Solve (ctx context.Context , req client.SolveRequest ) (* client.Result , error ) {
58
58
res , err := c .FrontendLLBBridge .Solve (ctx , frontend.SolveRequest {
59
59
Evaluate : req .Evaluate ,
60
60
Definition : req .Definition ,
@@ -91,7 +91,7 @@ func (c *bridgeClient) Solve(ctx context.Context, req client.SolveRequest) (*cli
91
91
92
92
return cRes , nil
93
93
}
94
- func (c * bridgeClient ) loadBuildOpts () client.BuildOpts {
94
+ func (c * BridgeClient ) loadBuildOpts () client.BuildOpts {
95
95
wis := c .workers .WorkerInfos ()
96
96
workers := make ([]client.WorkerInfo , len (wis ))
97
97
for i , w := range wis {
@@ -112,11 +112,11 @@ func (c *bridgeClient) loadBuildOpts() client.BuildOpts {
112
112
}
113
113
}
114
114
115
- func (c * bridgeClient ) BuildOpts () client.BuildOpts {
115
+ func (c * BridgeClient ) BuildOpts () client.BuildOpts {
116
116
return c .buildOpts
117
117
}
118
118
119
- func (c * bridgeClient ) Inputs (ctx context.Context ) (map [string ]llb.State , error ) {
119
+ func (c * BridgeClient ) Inputs (ctx context.Context ) (map [string ]llb.State , error ) {
120
120
inputs := make (map [string ]llb.State )
121
121
for key , def := range c .inputs {
122
122
defop , err := llb .NewDefinitionOp (def )
@@ -128,7 +128,7 @@ func (c *bridgeClient) Inputs(ctx context.Context) (map[string]llb.State, error)
128
128
return inputs , nil
129
129
}
130
130
131
- func (c * bridgeClient ) wrapSolveError (solveErr error ) error {
131
+ func (c * BridgeClient ) wrapSolveError (solveErr error ) error {
132
132
var (
133
133
ee * llberrdefs.ExecError
134
134
fae * llberrdefs.FileActionError
@@ -162,7 +162,7 @@ func (c *bridgeClient) wrapSolveError(solveErr error) error {
162
162
return errdefs .WithSolveError (solveErr , subject , inputIDs , mountIDs )
163
163
}
164
164
165
- func (c * bridgeClient ) registerResultIDs (results ... solver.Result ) (ids []string , err error ) {
165
+ func (c * BridgeClient ) registerResultIDs (results ... solver.Result ) (ids []string , err error ) {
166
166
c .mu .Lock ()
167
167
defer c .mu .Unlock ()
168
168
@@ -181,7 +181,7 @@ func (c *bridgeClient) registerResultIDs(results ...solver.Result) (ids []string
181
181
return ids , nil
182
182
}
183
183
184
- func (c * bridgeClient ) toFrontendResult (r * client.Result ) (* frontend.Result , error ) {
184
+ func (c * BridgeClient ) toFrontendResult (r * client.Result ) (* frontend.Result , error ) {
185
185
if r == nil {
186
186
return nil , nil
187
187
}
@@ -206,7 +206,7 @@ func (c *bridgeClient) toFrontendResult(r *client.Result) (*frontend.Result, err
206
206
return res , nil
207
207
}
208
208
209
- func (c * bridgeClient ) discard (err error ) {
209
+ func (c * BridgeClient ) discard (err error ) {
210
210
for _ , ctr := range c .ctrs {
211
211
ctr .Release (context .TODO ())
212
212
}
@@ -227,11 +227,11 @@ func (c *bridgeClient) discard(err error) {
227
227
}
228
228
}
229
229
230
- func (c * bridgeClient ) Warn (ctx context.Context , dgst digest.Digest , msg string , opts client.WarnOpts ) error {
230
+ func (c * BridgeClient ) Warn (ctx context.Context , dgst digest.Digest , msg string , opts client.WarnOpts ) error {
231
231
return c .FrontendLLBBridge .Warn (ctx , dgst , msg , opts )
232
232
}
233
233
234
- func (c * bridgeClient ) NewContainer (ctx context.Context , req client.NewContainerRequest ) (client.Container , error ) {
234
+ func (c * BridgeClient ) NewContainer (ctx context.Context , req client.NewContainerRequest ) (client.Container , error ) {
235
235
ctrReq := container.NewContainerRequest {
236
236
ContainerID : identity .NewID (),
237
237
NetMode : req .NetMode ,
@@ -307,7 +307,7 @@ func (c *bridgeClient) NewContainer(ctx context.Context, req client.NewContainer
307
307
return ctr , nil
308
308
}
309
309
310
- func (c * bridgeClient ) newRef (r solver.ResultProxy , s session.Group ) (* ref , error ) {
310
+ func (c * BridgeClient ) newRef (r solver.ResultProxy , s session.Group ) (* ref , error ) {
311
311
return & ref {resultProxy : r , session : s , c : c }, nil
312
312
}
313
313
@@ -316,7 +316,7 @@ type ref struct {
316
316
resultProxyClones []solver.ResultProxy
317
317
318
318
session session.Group
319
- c * bridgeClient
319
+ c * BridgeClient
320
320
}
321
321
322
322
func (r * ref ) acquireResultProxy () solver.ResultProxy {
0 commit comments