From 49763f525ade54cfb808b3d0fb606ef4771fb9cc Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Thu, 13 Aug 2020 15:21:59 -0700 Subject: [PATCH] Fix double attach on single http serve mux. --- internal/commands/root/http.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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,