Skip to content

Commit

Permalink
Fix return event publishing error
Browse files Browse the repository at this point in the history
Signed-off-by: Shiming Zhang <[email protected]>
  • Loading branch information
wzshiming committed Apr 9, 2021
1 parent d064140 commit 45df696
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/containerd-shim/main_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event
cmd := exec.CommandContext(ctx, containerdBinaryFlag, "--address", l.address, "publish", "--topic", topic, "--namespace", ns)
cmd.Stdin = bytes.NewReader(data)
b := bufPool.Get().(*bytes.Buffer)
defer bufPool.Put(b)
defer func() {
b.Reset()
bufPool.Put(b)
}()
cmd.Stdout = b
cmd.Stderr = b
c, err := reaper.Default.Start(cmd)
Expand Down

0 comments on commit 45df696

Please sign in to comment.