Skip to content

Commit

Permalink
Merge pull request #1491 from saschagrunert/events-interruptable
Browse files Browse the repository at this point in the history
Make `crictl events` interruptable
  • Loading branch information
k8s-ci-robot authored Jul 17, 2024
2 parents a6a89f6 + e970686 commit ac82070
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/crictl/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ func Events(cliContext *cli.Context, client internalapi.RuntimeService) error {
containerEventsCh := make(chan *pb.ContainerEventResponse)
go func() {
logrus.Debug("getting container events")
err := client.GetContainerEvents(context.Background(), containerEventsCh, nil)
_, err := InterruptableRPC(nil, func(ctx context.Context) (any, error) {
return nil, client.GetContainerEvents(ctx, containerEventsCh, nil)
})
if err == io.EOF {
errCh <- nil
return
Expand Down

0 comments on commit ac82070

Please sign in to comment.