Merge pull request #87754 from MikeSpreitzer/apf-filter5

Add twice refactored filter and config consumer for API Priority and Fairness
This commit is contained in:
Kubernetes Prow Robot
2020-02-13 16:54:46 -08:00
committed by GitHub
32 changed files with 3117 additions and 316 deletions

View File

@@ -27,7 +27,14 @@ import (
// BuildInsecureHandlerChain sets up the server to listen to http. Should be removed.
func BuildInsecureHandlerChain(apiHandler http.Handler, c *server.Config) http.Handler {
handler := apiHandler
handler = genericfilters.WithMaxInFlightLimit(handler, c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight, c.LongRunningFunc)
// Temporarily disable APIPriorityAndFairness during development
// so that /debug/pprof works even while this feature is totally
// hosed
if c.FlowControl != nil && false {
handler = genericfilters.WithPriorityAndFairness(handler, c.LongRunningFunc, c.FlowControl)
} else {
handler = genericfilters.WithMaxInFlightLimit(handler, c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight, c.LongRunningFunc)
}
handler = genericapifilters.WithAudit(handler, c.AuditBackend, c.AuditPolicyChecker, c.LongRunningFunc)
handler = genericapifilters.WithAuthentication(handler, server.InsecureSuperuser{}, nil, nil)
handler = genericfilters.WithCORS(handler, c.CorsAllowedOriginList, nil, nil, nil, "true")