Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix double attach on single http serve mux.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpuguy83 committed Aug 13, 2020
1 parent d9f54a5 commit 49763f5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/commands/root/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 49763f5

Please sign in to comment.