Skip to content

Commit

Permalink
CRI client: use default timeout for ImageFsInfo RPC
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
saschagrunert committed Oct 14, 2024
1 parent faf89fe commit e055a1f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions staging/src/k8s.io/cri-client/pkg/remote_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e055a1f

Please sign in to comment.