MCPcopy
hub / github.com/kubernetes/client-go / RunOrDie

Function RunOrDie

tools/leaderelection/leaderelection.go:206–215  ·  view source on GitHub ↗

RunOrDie starts a client with the provided config or panics if the config fails to validate.

(ctx context.Context, lec LeaderElectionConfig)

Source from the content-addressed store, hash-verified

204// RunOrDie starts a client with the provided config or panics if the config
205// fails to validate.
206func 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.

Callers 1

mainFunction · 0.92

Calls 3

RunMethod · 0.95
NewLeaderElectorFunction · 0.85
SetLeaderElectionMethod · 0.80

Tested by

no test coverage detected