mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
allow for passing a custom handler to the empty delegate
This commit is contained in:
parent
d9896a23bc
commit
207478c1e6
@ -271,14 +271,20 @@ func (s *GenericAPIServer) NextDelegate() DelegationTarget {
|
||||
}
|
||||
|
||||
type emptyDelegate struct {
|
||||
handler http.Handler
|
||||
}
|
||||
|
||||
func NewEmptyDelegate() DelegationTarget {
|
||||
return emptyDelegate{}
|
||||
}
|
||||
|
||||
// NewEmptyDelegateWithCustomHandler allows for registering a custom handler usually for special handling of 404 requests
|
||||
func NewEmptyDelegateWithCustomHandler(handler http.Handler) DelegationTarget {
|
||||
return emptyDelegate{handler}
|
||||
}
|
||||
|
||||
func (s emptyDelegate) UnprotectedHandler() http.Handler {
|
||||
return nil
|
||||
return s.handler
|
||||
}
|
||||
func (s emptyDelegate) PostStartHooks() map[string]postStartHookEntry {
|
||||
return map[string]postStartHookEntry{}
|
||||
|
Loading…
Reference in New Issue
Block a user