Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksontong committed Jul 25, 2024
1 parent 898e2ff commit 725e82f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions pkg/controller/options/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ type ComponentOptions struct {

allControllers []string
disabledByDefaultControllers []string

Debugging componentconfig.DebuggingConfiguration
}

// ComponentConfiguration holds configuration for a generic controller-manager
Expand Down Expand Up @@ -128,7 +126,6 @@ func NewComponentOptions(allControllers []string, disabledByDefaultControllers [
ContainerRegistryDomain: "docker.io",
allControllers: allControllers,
disabledByDefaultControllers: disabledByDefaultControllers,
Debugging: componentconfig.DebuggingConfiguration{EnableProfiling: true},
}
}

Expand Down Expand Up @@ -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
}
10 changes: 5 additions & 5 deletions pkg/controller/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 725e82f

Please sign in to comment.