mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
[Leader election] Add documentation to function
This commit is contained in:
parent
5c58b22251
commit
852075b23c
@ -145,6 +145,9 @@ 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.
|
// 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) {
|
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
|
// shallow copy, do not modify the kubeconfig
|
||||||
config := *kubeconfig
|
config := *kubeconfig
|
||||||
|
Loading…
Reference in New Issue
Block a user