Skip to content

Commit

Permalink
Merge pull request #1658 from facchettos/infofromcontext
Browse files Browse the repository at this point in the history
moved withinterceptor so it can catch the info from the context
  • Loading branch information
FabianKramm authored Apr 8, 2024
2 parents 6be8fd2 + 5b16729 commit 8e03e13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ func createCachedClient(ctx context.Context, config *rest.Config, namespace stri
func (s *Server) buildHandlerChain(serverConfig *server.Config) http.Handler {
defaultHandler := DefaultBuildHandlerChain(s.handler, serverConfig)
defaultHandler = filters.WithNodeName(defaultHandler, s.currentNamespace, s.fakeKubeletIPs, s.cachedVirtualClient, s.currentNamespaceClient)
defaultHandler = plugin.DefaultManager.WithInterceptors(defaultHandler)
return defaultHandler
}

Expand Down Expand Up @@ -424,6 +423,10 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *server.Config) http.Ha
handler = genericapifilters.WithTracing(handler, c.TracerProvider)
}
handler = genericapifilters.WithLatencyTrackers(handler)

// this is for the plugins to be able to catch the requests with the info in the
// context
handler = plugin.DefaultManager.WithInterceptors(handler)
handler = genericapifilters.WithRequestInfo(handler, c.RequestInfoResolver)
handler = genericapifilters.WithRequestReceivedTimestamp(handler)

Expand Down

0 comments on commit 8e03e13

Please sign in to comment.