mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #116555 from bart0sh/PR106-dra-plugin-constant
DRA: add constant PluginClientTimeout
This commit is contained in:
commit
e998b09bc4
@ -32,6 +32,8 @@ import (
|
|||||||
drapbv1 "k8s.io/kubelet/pkg/apis/dra/v1alpha1"
|
drapbv1 "k8s.io/kubelet/pkg/apis/dra/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const PluginClientTimeout = 10 * time.Second
|
||||||
|
|
||||||
type Client interface {
|
type Client interface {
|
||||||
NodePrepareResource(
|
NodePrepareResource(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -132,7 +134,7 @@ func (r *draPluginClient) NodePrepareResource(
|
|||||||
ResourceHandle: resourceHandle,
|
ResourceHandle: resourceHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
ctx, cancel := context.WithTimeout(ctx, PluginClientTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
return nodeClient.NodePrepareResource(ctx, req)
|
return nodeClient.NodePrepareResource(ctx, req)
|
||||||
@ -169,7 +171,7 @@ func (r *draPluginClient) NodeUnprepareResource(
|
|||||||
CdiDevices: cdiDevices,
|
CdiDevices: cdiDevices,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
ctx, cancel := context.WithTimeout(ctx, PluginClientTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
return nodeClient.NodeUnprepareResource(ctx, req)
|
return nodeClient.NodeUnprepareResource(ctx, req)
|
||||||
|
Loading…
Reference in New Issue
Block a user