allow for passing a custom handler to the empty delegate
Kubernetes-commit: 207478c1e6f94b26d8033d5edc7a8a91c69ef716
This commit is contained in:
parent
f4eed88dd1
commit
b96eea9892
|
@ -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