Update k8s dependency version to 1.21
Signed-off-by: xinyanwu409 <wxinyan@vmware>
This commit is contained in:
5
vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go
generated
vendored
5
vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go
generated
vendored
@@ -145,10 +145,13 @@ func New(lockType string, ns string, name string, coreClient corev1.CoreV1Interf
|
||||
}
|
||||
|
||||
// NewFromKubeconfig will create a lock of a given type according to the input parameters.
|
||||
// Timeout set for a client used to contact to Kubernetes should be lower than
|
||||
// RenewDeadline to keep a single hung request from forcing a leader loss.
|
||||
// Setting it to max(time.Second, RenewDeadline/2) as a reasonable heuristic.
|
||||
func NewFromKubeconfig(lockType string, ns string, name string, rlc ResourceLockConfig, kubeconfig *restclient.Config, renewDeadline time.Duration) (Interface, error) {
|
||||
// shallow copy, do not modify the kubeconfig
|
||||
config := *kubeconfig
|
||||
timeout := ((renewDeadline / time.Millisecond) / 2) * time.Millisecond
|
||||
timeout := renewDeadline / 2
|
||||
if timeout < time.Second {
|
||||
timeout = time.Second
|
||||
}
|
||||
|
Reference in New Issue
Block a user