split up the component config into smaller config

This commit is contained in:
stewart-yu
2018-04-12 11:12:10 +08:00
parent 75e39073a3
commit ec6399be53
12 changed files with 688 additions and 422 deletions

View File

@@ -26,7 +26,6 @@ import (
// Config is the main context object for the controller manager.
type Config struct {
// TODO: split up the component config. This is not generic.
ComponentConfig componentconfig.KubeControllerManagerConfiguration
SecureServing *apiserver.SecureServingInfo

View File

@@ -40,9 +40,9 @@ type serveFunc func(handler http.Handler, shutdownTimeout time.Duration, stopCh
func Serve(c *CompletedConfig, serveFunc serveFunc, stopCh <-chan struct{}) error {
mux := mux.NewPathRecorderMux("controller-manager")
healthz.InstallHandler(mux)
if c.ComponentConfig.EnableProfiling {
if c.ComponentConfig.Debugging.EnableProfiling {
routes.Profiling{}.Install(mux)
if c.ComponentConfig.EnableContentionProfiling {
if c.ComponentConfig.Debugging.EnableContentionProfiling {
goruntime.SetBlockProfileRate(1)
}
}