RunOrDie starts a client with the provided config or panics if the config fails to validate.
(ctx context.Context, lec LeaderElectionConfig)
| 204 | // RunOrDie starts a client with the provided config or panics if the config |
| 205 | // fails to validate. |
| 206 | func RunOrDie(ctx context.Context, lec LeaderElectionConfig) { |
| 207 | le, err := NewLeaderElector(lec) |
| 208 | if err != nil { |
| 209 | panic(err) |
| 210 | } |
| 211 | if lec.WatchDog != nil { |
| 212 | lec.WatchDog.SetLeaderElection(le) |
| 213 | } |
| 214 | le.Run(ctx) |
| 215 | } |
| 216 | |
| 217 | // GetLeader returns the identity of the last observed leader or returns the empty string if |
| 218 | // no leader has yet been observed. |
no test coverage detected