Skip to content

Commit 05d3ffb

Browse files
author
Mengqi Yu
committed
support register arbitrary http.Handler in Server
1 parent 4181066 commit 05d3ffb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/webhook/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ func (s *Server) Register(webhooks ...Webhook) error {
180180
return s.manager.Add(s)
181181
}
182182

183+
// Handle registers a http.Handler for the given pattern.
184+
func (s *Server) Handle(pattern string, handler http.Handler) {
185+
s.sMux.Handle(pattern, handler)
186+
}
187+
183188
var _ manager.Runnable = &Server{}
184189

185190
// Start runs the server if s.Dryrun is false.

0 commit comments

Comments
 (0)