Skip to content

Commit

Permalink
Set single export entry outside of session initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Edgar Lee <edgarl@netflix.com>
  • Loading branch information
hinshun committed Apr 8, 2020
1 parent 423f5f8 commit d42b8bf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions client/solve.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
}

var ex ExportEntry
if len(opt.Exports) > 1 {
return nil, errors.New("currently only single Exports can be specified")
}
if len(opt.Exports) == 1 {
ex = opt.Exports[0]
}

if !opt.SessionPreInitialized {
if len(syncedDirs) > 0 {
Expand All @@ -125,13 +131,6 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG
s.Allow(a)
}

if len(opt.Exports) > 1 {
return nil, errors.New("currently only single Exports can be specified")
}
if len(opt.Exports) == 1 {
ex = opt.Exports[0]
}

switch ex.Type {
case ExporterLocal:
if ex.Output != nil {
Expand Down

0 comments on commit d42b8bf

Please sign in to comment.