From 5b16729ea07f4236a7481f2c4ff25716eb3c3c0d Mon Sep 17 00:00:00 2001 From: facchettos Date: Mon, 8 Apr 2024 10:19:41 +0200 Subject: [PATCH] moved withinterceptor so it can catch the info from the context --- pkg/server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index 52a416055..575720218 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -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 } @@ -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)