mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #62268 from max8899/master
Automatic merge from submit-queue (batch tested with PRs 61010, 61315, 62268). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix some shadow declaration in cmd package **What this PR does / why we need it**: There are some shadow declaration variables used in cmd package. Release note: ``` NONE ``` Signed-off-by: Lei Gong <lgong@alauda.io>
This commit is contained in:
commit
1aa4dd04d7
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user