From e055a1f89aa3098210ee594f5c5c1ce84a634a67 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Mon, 14 Oct 2024 13:49:01 +0200 Subject: [PATCH] CRI client: use default timeout for ImageFsInfo RPC The RPC call usually does not take much time for containerd or CRI-O. We now assume the default timeout is fine and therefore resolve the `TODO`. Signed-off-by: Sascha Grunert --- staging/src/k8s.io/cri-client/pkg/remote_image.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/staging/src/k8s.io/cri-client/pkg/remote_image.go b/staging/src/k8s.io/cri-client/pkg/remote_image.go index b067697766b..faf4bdc80b7 100644 --- a/staging/src/k8s.io/cri-client/pkg/remote_image.go +++ b/staging/src/k8s.io/cri-client/pkg/remote_image.go @@ -232,9 +232,7 @@ func (r *remoteImageService) RemoveImage(ctx context.Context, image *runtimeapi. // ImageFsInfo returns information of the filesystem that is used to store images. func (r *remoteImageService) ImageFsInfo(ctx context.Context) (*runtimeapi.ImageFsInfoResponse, error) { - // Do not set timeout, because `ImageFsInfo` takes time. - // TODO(random-liu): Should we assume runtime should cache the result, and set timeout here? - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithTimeout(ctx, r.timeout) defer cancel() return r.imageFsInfoV1(ctx)