mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +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"))
|
||||
|
||||
// Configz registration.
|
||||
cz, err := configz.New("componentconfig")
|
||||
if err != nil {
|
||||
if cz, err := configz.New("componentconfig"); err != nil {
|
||||
return fmt.Errorf("unable to register configz: %s", err)
|
||||
}
|
||||
cz.Set(cc.ComponentConfig)
|
||||
|
Loading…
Reference in New Issue
Block a user