Skip to content

Commit d50a2ed

Browse files
author
Mengqi Yu
committed
support register arbitrary http.Handler in Server
1 parent 752480a commit d50a2ed

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
@@ -182,6 +182,11 @@ func (s *Server) Register(webhooks ...Webhook) error {
182182
return s.manager.Add(s)
183183
}
184184

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

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

0 commit comments

Comments
 (0)