diff --git a/internal/commands/root/http.go b/internal/commands/root/http.go index d02574a..0c1e371 100644 --- a/internal/commands/root/http.go +++ b/internal/commands/root/http.go @@ -96,16 +96,11 @@ func setupHTTPServer(ctx context.Context, p provider.Provider, cfg *apiServerCon StreamIdleTimeout: cfg.StreamIdleTimeout, StreamCreationTimeout: cfg.StreamCreationTimeout, } - api.AttachPodRoutes(podRoutes, mux, true) - var summaryHandlerFunc api.PodStatsSummaryHandlerFunc if mp, ok := p.(provider.PodMetricsProvider); ok { - summaryHandlerFunc = mp.GetStatsSummary - } - podMetricsRoutes := api.PodMetricsConfig{ - GetStatsSummary: summaryHandlerFunc, + podRoutes.GetStatsSummary = mp.GetStatsSummary } - api.AttachPodMetricsRoutes(podMetricsRoutes, mux) + api.AttachPodRoutes(podRoutes, mux, true) s := &http.Server{ Handler: mux,