Skip to content

Commit cc2e7bf

Browse files
authored
pin output to out.tar regardless of dest argument (#40)
1 parent 6ede3df commit cc2e7bf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkg/build/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func Build(ctx context.Context, opts *BOpts) error {
8888
export.Output = func(map[string]string) (io.WriteCloser, error) {
8989
return wf, nil
9090
}
91-
export.Attrs["output"] = filepath.Join(opts.basePath, "out.tar")
91+
export.Attrs["output"] = filepath.Join(GlobalExportPath, opts.BuildID, "out.tar")
9292
if _, ok := export.Attrs["name"]; !ok {
9393
export.Attrs["name"] = opts.Tag
9494
}

pkg/stream/pipeline.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ func (p *StreamPipeline) Run() error {
120120
case err == nil:
121121
stage.process(pkt)
122122
handled = true
123-
break
124123
case errors.Is(err, ErrIgnorePacket):
125124
continue
126125
default: // real error
127126
logrus.WithError(err).Warn("Filter error")
128127
continue
129128
}
129+
if handled {
130+
break
131+
}
130132
}
131133
if !handled {
132134
logrus.WithField("build_id", pkt.BuildId).Debug("dropped unhandled packet")
@@ -136,6 +138,6 @@ func (p *StreamPipeline) Run() error {
136138

137139
<-p.ctx.Done()
138140
p.wg.Wait()
139-
close(p.sendCh)
141+
// Don't close sendCh - let it be garbage collected to avoid "send on closed channel" panic
140142
return p.ctx.Err()
141143
}

0 commit comments

Comments
 (0)