Skip to content

Commit d850185

Browse files
author
Mengqi Yu
committed
✨ webhook server doesn't use leader election by default
1 parent 96b67f2 commit d850185

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/webhook/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ func (s *Server) setDefaults() {
8989
}
9090
}
9191

92+
// NeedLeaderElection implements the LeaderElectionRunnable interface, which indicates
93+
// the webhook server doesn't need leader election.
94+
func (*Server) NeedLeaderElection() bool {
95+
return false
96+
}
97+
9298
// Register marks the given webhook as being served at the given path.
9399
// It panics if two hooks are registered on the same path.
94100
func (s *Server) Register(path string, hook http.Handler) {

0 commit comments

Comments
 (0)