From 495e0ef077bbb905f470410bba0426d8081a42d8 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 2 Jul 2024 12:03:34 +0200 Subject: [PATCH] cri: allow `GetContainerEvents` to pass a context 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 Kubernetes-commit: ae8f6f002d2aae72482b4989a833b16b33c019d5 --- pkg/apis/services.go | 2 +- pkg/apis/testing/fake_runtime_service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/services.go b/pkg/apis/services.go index 74e1ded..2d56783 100644 --- a/pkg/apis/services.go +++ b/pkg/apis/services.go @@ -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 diff --git a/pkg/apis/testing/fake_runtime_service.go b/pkg/apis/testing/fake_runtime_service.go index 989d281..56effd2 100644 --- a/pkg/apis/testing/fake_runtime_service.go +++ b/pkg/apis/testing/fake_runtime_service.go @@ -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 }