mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Refactor error handling for configz initialization
Improved code readability and limited variable scope as per reviewer's suggestion.
This commit is contained in:
parent
b390ae24d0
commit
2faaedbe39
@ -169,8 +169,7 @@ func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *
|
|||||||
logger.Info("Golang settings", "GOGC", os.Getenv("GOGC"), "GOMAXPROCS", os.Getenv("GOMAXPROCS"), "GOTRACEBACK", os.Getenv("GOTRACEBACK"))
|
logger.Info("Golang settings", "GOGC", os.Getenv("GOGC"), "GOMAXPROCS", os.Getenv("GOMAXPROCS"), "GOTRACEBACK", os.Getenv("GOTRACEBACK"))
|
||||||
|
|
||||||
// Configz registration.
|
// Configz registration.
|
||||||
cz, err := configz.New("componentconfig")
|
if cz, err := configz.New("componentconfig"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to register configz: %s", err)
|
return fmt.Errorf("unable to register configz: %s", err)
|
||||||
}
|
}
|
||||||
cz.Set(cc.ComponentConfig)
|
cz.Set(cc.ComponentConfig)
|
||||||
|
Loading…
Reference in New Issue
Block a user