mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
dynamic resource allocation: add timeouts for communiction with plugin (#114844)
* add timeouts for communication with dra plugin * move timeout constant to k8s.io/kubernetes/pkg/kubelet/cm/util * move settings of timeout to pkg/kubelet/plugin/dra/plugin/client.go * remove timeout constant
This commit is contained in:
parent
185cd95b9c
commit
d34b0275a3
@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
@ -131,6 +132,9 @@ func (r *draPluginClient) NodePrepareResource(
|
|||||||
ResourceHandle: resourceHandle,
|
ResourceHandle: resourceHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
return nodeClient.NodePrepareResource(ctx, req)
|
return nodeClient.NodePrepareResource(ctx, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,6 +169,9 @@ func (r *draPluginClient) NodeUnprepareResource(
|
|||||||
CdiDevices: cdiDevices,
|
CdiDevices: cdiDevices,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
return nodeClient.NodeUnprepareResource(ctx, req)
|
return nodeClient.NodeUnprepareResource(ctx, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user