Merge pull request #128052 from saschagrunert/imagefsinfo-timeout

CRI client: use default timeout for ImageFsInfo RPC
This commit is contained in:
Kubernetes Prow Robot 2024-10-14 15:16:28 +01:00 committed by GitHub
commit 7f5510921d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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.
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)