File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -498,16 +498,23 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
498
498
Comparator : nodeInfoComparator ,
499
499
}
500
500
501
- stop := make (chan struct {})
502
- informerFactory .Start (stop )
503
-
504
501
// These metrics should be published only once.
505
502
metrics .UpdateNapEnabled (autoscalingOptions .NodeAutoprovisioningEnabled )
506
503
metrics .UpdateCPULimitsCores (autoscalingOptions .MinCoresTotal , autoscalingOptions .MaxCoresTotal )
507
504
metrics .UpdateMemoryLimitsBytes (autoscalingOptions .MinMemoryTotal , autoscalingOptions .MaxMemoryTotal )
508
505
509
506
// Create autoscaler.
510
- return core .NewAutoscaler (opts )
507
+ autoscaler , err := core .NewAutoscaler (opts )
508
+ if err != nil {
509
+ return nil , err
510
+ }
511
+
512
+ // Start informers. This must come after fully constructing the autoscaler because
513
+ // additional informers might have been registered in the factory during NewAutoscaler.
514
+ stop := make (chan struct {})
515
+ informerFactory .Start (stop )
516
+
517
+ return autoscaler , nil
511
518
}
512
519
513
520
func run (healthCheck * metrics.HealthCheck , debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter ) {
You can’t perform that action at this time.
0 commit comments