Skip to content

Commit 9cc65ce

Browse files
committed
Restrict cz variable scope within else clause
1 parent 2faaedb commit 9cc65ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/kube-scheduler/app/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *
171171
// Configz registration.
172172
if cz, err := configz.New("componentconfig"); err != nil {
173173
return fmt.Errorf("unable to register configz: %s", err)
174+
} else {
175+
cz.Set(cc.ComponentConfig)
174176
}
175-
cz.Set(cc.ComponentConfig)
176177

177178
// Start events processing pipeline.
178179
cc.EventBroadcaster.StartRecordingToSink(ctx.Done())

0 commit comments

Comments
 (0)