Skip to content

Commit e055a1f

Browse files
committed
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 <[email protected]>
1 parent faf89fe commit e055a1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

staging/src/k8s.io/cri-client/pkg/remote_image.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ func (r *remoteImageService) RemoveImage(ctx context.Context, image *runtimeapi.
232232

233233
// ImageFsInfo returns information of the filesystem that is used to store images.
234234
func (r *remoteImageService) ImageFsInfo(ctx context.Context) (*runtimeapi.ImageFsInfoResponse, error) {
235-
// Do not set timeout, because `ImageFsInfo` takes time.
236-
// TODO(random-liu): Should we assume runtime should cache the result, and set timeout here?
237-
ctx, cancel := context.WithCancel(ctx)
235+
ctx, cancel := context.WithTimeout(ctx, r.timeout)
238236
defer cancel()
239237

240238
return r.imageFsInfoV1(ctx)

0 commit comments

Comments
 (0)