mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
Add timeout to listContainerStats context
Signed-off-by: Harshal Patil <harpatil@redhat.com>
This commit is contained in:
parent
3cf3702d1e
commit
2e174a029f
@ -674,9 +674,7 @@ func (r *remoteRuntimeService) containerStatsV1(ctx context.Context, containerID
|
|||||||
// ListContainerStats returns the list of ContainerStats given the filter.
|
// ListContainerStats returns the list of ContainerStats given the filter.
|
||||||
func (r *remoteRuntimeService) ListContainerStats(ctx context.Context, filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error) {
|
func (r *remoteRuntimeService) ListContainerStats(ctx context.Context, filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error) {
|
||||||
klog.V(10).InfoS("[RemoteRuntimeService] ListContainerStats", "filter", filter)
|
klog.V(10).InfoS("[RemoteRuntimeService] ListContainerStats", "filter", filter)
|
||||||
// Do not set timeout, because writable layer stats collection 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.listContainerStatsV1(ctx, filter)
|
return r.listContainerStatsV1(ctx, filter)
|
||||||
|
Loading…
Reference in New Issue
Block a user