Merge pull request #5293 from wzshiming/fix/eveny-error-message

Fix return event publishing error
This commit is contained in:
Derek McGowan 2021-04-13 20:32:37 -07:00 committed by GitHub
commit 5c6ea7fdc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 := exec.CommandContext(ctx, containerdBinaryFlag, "--address", l.address, "publish", "--topic", topic, "--namespace", ns)
cmd.Stdin = bytes.NewReader(data) cmd.Stdin = bytes.NewReader(data)
b := bufPool.Get().(*bytes.Buffer) b := bufPool.Get().(*bytes.Buffer)
defer bufPool.Put(b) defer func() {
b.Reset()
bufPool.Put(b)
}()
cmd.Stdout = b cmd.Stdout = b
cmd.Stderr = b cmd.Stderr = b
c, err := reaper.Default.Start(cmd) c, err := reaper.Default.Start(cmd)