Skip to content

Commit 9f66e2a

Browse files
committed
dockerui: use CachedGroup in dockerui context resolve
Signed-off-by: Tonis Tiigi <[email protected]>
1 parent cd38624 commit 9f66e2a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

frontend/dockerui/config.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ type Client struct {
7878
Config
7979
client client.Client
8080
ignoreCache []string
81-
bctx *buildContext
82-
g flightcontrol.Group[*buildContext]
81+
g flightcontrol.CachedGroup[*buildContext]
8382
bopts client.BuildOpts
8483

8584
dockerignore []byte
@@ -288,14 +287,7 @@ func (bc *Client) init() error {
288287

289288
func (bc *Client) buildContext(ctx context.Context) (*buildContext, error) {
290289
return bc.g.Do(ctx, "initcontext", func(ctx context.Context) (*buildContext, error) {
291-
if bc.bctx != nil {
292-
return bc.bctx, nil
293-
}
294-
bctx, err := bc.initContext(ctx)
295-
if err == nil {
296-
bc.bctx = bctx
297-
}
298-
return bctx, err
290+
return bc.initContext(ctx)
299291
})
300292
}
301293

0 commit comments

Comments
 (0)