diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index d2e04581..0cd39aa3 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -444,7 +444,7 @@ }, { "ImportPath": "k8s.io/apimachinery", - "Rev": "9254095ca5ca" + "Rev": "1bdd76d09076" }, { "ImportPath": "k8s.io/gengo", diff --git a/go.mod b/go.mod index b4077b07..e85e8b16 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 k8s.io/api v0.0.0-20200821051526-051d027c14e1 - k8s.io/apimachinery v0.0.0-20200821051348-9254095ca5ca + k8s.io/apimachinery v0.0.0-20200827091422-1bdd76d09076 k8s.io/klog/v2 v2.2.0 k8s.io/utils v0.0.0-20200729134348-d5654de09c73 sigs.k8s.io/yaml v1.2.0 @@ -35,5 +35,5 @@ require ( replace ( k8s.io/api => k8s.io/api v0.0.0-20200821051526-051d027c14e1 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20200821051348-9254095ca5ca + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20200827091422-1bdd76d09076 ) diff --git a/go.sum b/go.sum index 3d081ab7..fe08b20b 100644 --- a/go.sum +++ b/go.sum @@ -334,7 +334,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20200821051526-051d027c14e1/go.mod h1:6DKPkNII5GHfkmzU2WRXuDEJXvErpzTgkC/GRlsMFOQ= -k8s.io/apimachinery v0.0.0-20200821051348-9254095ca5ca/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apimachinery v0.0.0-20200827091422-1bdd76d09076/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index 4a532968..2c0ee381 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -193,7 +193,9 @@ type LeaderElector struct { name string } -// Run starts the leader election loop +// Run starts the leader election loop. Run will not return +// before leader election loop is stopped by ctx or it has +// stopped holding the leader lease func (le *LeaderElector) Run(ctx context.Context) { defer runtime.HandleCrash() defer func() { @@ -210,7 +212,8 @@ func (le *LeaderElector) Run(ctx context.Context) { } // RunOrDie starts a client with the provided config or panics if the config -// fails to validate. +// fails to validate. RunOrDie blocks until leader election loop is +// stopped by ctx or it has stopped holding the leader lease func RunOrDie(ctx context.Context, lec LeaderElectionConfig) { le, err := NewLeaderElector(lec) if err != nil {