From 725e82f8aec944c597c11c325b3ac63c19f8c119 Mon Sep 17 00:00:00 2001 From: jacksontong Date: Thu, 25 Jul 2024 19:33:58 +0800 Subject: [PATCH] update --- pkg/controller/options/component.go | 4 ---- pkg/controller/server.go | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/controller/options/component.go b/pkg/controller/options/component.go index 1dcf9143d..5ffb0cf99 100755 --- a/pkg/controller/options/component.go +++ b/pkg/controller/options/component.go @@ -62,8 +62,6 @@ type ComponentOptions struct { allControllers []string disabledByDefaultControllers []string - - Debugging componentconfig.DebuggingConfiguration } // ComponentConfiguration holds configuration for a generic controller-manager @@ -128,7 +126,6 @@ func NewComponentOptions(allControllers []string, disabledByDefaultControllers [ ContainerRegistryDomain: "docker.io", allControllers: allControllers, disabledByDefaultControllers: disabledByDefaultControllers, - Debugging: componentconfig.DebuggingConfiguration{EnableProfiling: true}, } } @@ -214,6 +211,5 @@ func (o *ComponentOptions) ApplyTo(cfg *ComponentConfiguration) error { cfg.LeaderElection.RetryPeriod = metav1.Duration{Duration: o.LeaderElection.RetryPeriod} cfg.LeaderElection.RenewDeadline = metav1.Duration{Duration: o.LeaderElection.RenewDeadline} cfg.LeaderElection.LeaseDuration = metav1.Duration{Duration: o.LeaderElection.LeaseDuration} - cfg.Debugging = o.Debugging return nil } diff --git a/pkg/controller/server.go b/pkg/controller/server.go index 13742cbed..cc2087af8 100644 --- a/pkg/controller/server.go +++ b/pkg/controller/server.go @@ -56,12 +56,12 @@ func BuildHandlerChain(apiHandler http.Handler, authorizationInfo *apiserver.Aut func NewBaseHandler(c *componentconfig.DebuggingConfiguration, checks ...healthz.HealthChecker) *mux.PathRecorderMux { m := mux.NewPathRecorderMux("controller-manager") healthz.InstallHandler(m, checks...) - //if c.EnableProfiling { - routes.Profiling{}.Install(m) - if c.EnableContentionProfiling { - goruntime.SetBlockProfileRate(1) + if c.EnableProfiling { + routes.Profiling{}.Install(m) + if c.EnableContentionProfiling { + goruntime.SetBlockProfileRate(1) + } } - //} m.Handle("/metrics", legacyregistry.HandlerWithReset()) return m