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 <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert 2024-10-14 13:49:01 +02:00
parent faf89fe5e9
commit e055a1f89a
No known key found for this signature in database
GPG Key ID: 09D97D153EF94D93

View File

@ -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. // ImageFsInfo returns information of the filesystem that is used to store images.
func (r *remoteImageService) ImageFsInfo(ctx context.Context) (*runtimeapi.ImageFsInfoResponse, error) { func (r *remoteImageService) ImageFsInfo(ctx context.Context) (*runtimeapi.ImageFsInfoResponse, error) {
// Do not set timeout, because `ImageFsInfo` takes time. ctx, cancel := context.WithTimeout(ctx, r.timeout)
// TODO(random-liu): Should we assume runtime should cache the result, and set timeout here?
ctx, cancel := context.WithCancel(ctx)
defer cancel() defer cancel()
return r.imageFsInfoV1(ctx) return r.imageFsInfoV1(ctx)