From 4d155cf7a75b8e658f257a96dca979b15f4875ec Mon Sep 17 00:00:00 2001 From: Lei Gong Date: Mon, 9 Apr 2018 13:44:32 +0800 Subject: [PATCH] Fix some shadow declaration in cmd package Signed-off-by: Lei Gong --- cmd/kube-scheduler/app/server.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/kube-scheduler/app/server.go b/cmd/kube-scheduler/app/server.go index c557ce93c85..3ef5c1d0d05 100644 --- a/cmd/kube-scheduler/app/server.go +++ b/cmd/kube-scheduler/app/server.go @@ -482,38 +482,38 @@ func makeLeaderElectionConfig(config componentconfig.KubeSchedulerLeaderElection // embed the metrics handler if the healthz and metrics address configurations // are the same. func makeHealthzServer(config *componentconfig.KubeSchedulerConfiguration) *http.Server { - mux := mux.NewPathRecorderMux("kube-scheduler") - healthz.InstallHandler(mux) + pathRecorderMux := mux.NewPathRecorderMux("kube-scheduler") + healthz.InstallHandler(pathRecorderMux) if config.HealthzBindAddress == config.MetricsBindAddress { - configz.InstallHandler(mux) - mux.Handle("/metrics", prometheus.Handler()) + configz.InstallHandler(pathRecorderMux) + pathRecorderMux.Handle("/metrics", prometheus.Handler()) } if config.EnableProfiling { - routes.Profiling{}.Install(mux) + routes.Profiling{}.Install(pathRecorderMux) if config.EnableContentionProfiling { goruntime.SetBlockProfileRate(1) } } return &http.Server{ Addr: config.HealthzBindAddress, - Handler: mux, + Handler: pathRecorderMux, } } // makeMetricsServer builds a metrics server from the config. func makeMetricsServer(config *componentconfig.KubeSchedulerConfiguration) *http.Server { - mux := mux.NewPathRecorderMux("kube-scheduler") - configz.InstallHandler(mux) - mux.Handle("/metrics", prometheus.Handler()) + pathRecorderMux := mux.NewPathRecorderMux("kube-scheduler") + configz.InstallHandler(pathRecorderMux) + pathRecorderMux.Handle("/metrics", prometheus.Handler()) if config.EnableProfiling { - routes.Profiling{}.Install(mux) + routes.Profiling{}.Install(pathRecorderMux) if config.EnableContentionProfiling { goruntime.SetBlockProfileRate(1) } } return &http.Server{ Addr: config.MetricsBindAddress, - Handler: mux, + Handler: pathRecorderMux, } }