Skip to content

Commit

Permalink
cri: allow GetContainerEvents to pass a context
Browse files Browse the repository at this point in the history
The context can be used for timeout purposes for example, not really for
Kubernetes but other consumers like cri-tools.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Kubernetes-commit: ae8f6f002d2aae72482b4989a833b16b33c019d5
  • Loading branch information
saschagrunert authored and k8s-publishing-bot committed Jul 2, 2024
1 parent 61d3787 commit 495e0ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type ContainerManager interface {
// CheckpointContainer checkpoints a container
CheckpointContainer(ctx context.Context, options *runtimeapi.CheckpointContainerRequest) error
// GetContainerEvents gets container events from the CRI runtime
GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse, connectionEstablishedCallback func(runtimeapi.RuntimeService_GetContainerEventsClient)) error
GetContainerEvents(ctx context.Context, containerEventsCh chan *runtimeapi.ContainerEventResponse, connectionEstablishedCallback func(runtimeapi.RuntimeService_GetContainerEventsClient)) error
}

// PodSandboxManager contains methods for operating on PodSandboxes. The methods
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/testing/fake_runtime_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func (r *FakeRuntimeService) CheckpointContainer(_ context.Context, options *run
return nil
}

func (f *FakeRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse, connectionEstablishedCallback func(runtimeapi.RuntimeService_GetContainerEventsClient)) error {
func (f *FakeRuntimeService) GetContainerEvents(ctx context.Context, containerEventsCh chan *runtimeapi.ContainerEventResponse, connectionEstablishedCallback func(runtimeapi.RuntimeService_GetContainerEventsClient)) error {
return nil
}

Expand Down

0 comments on commit 495e0ef

Please sign in to comment.