File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -146,15 +146,6 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError
146146 status .GetReadableString (), a .AutoscalingContext .LogRecorder )
147147 }
148148 }()
149- if ! a .ClusterStateRegistry .IsClusterHealthy () {
150- glog .Warning ("Cluster is not ready for autoscaling" )
151- scaleDown .CleanUpUnneededNodes ()
152- return nil
153- }
154-
155- metrics .UpdateDurationFromStart (metrics .UpdateState , runStart )
156- metrics .UpdateLastTime (metrics .Autoscaling , time .Now ())
157-
158149 // Check if there are any nodes that failed to register in Kubernetes
159150 // master.
160151 unregisteredNodes := a .ClusterStateRegistry .GetUnregisteredNodes ()
@@ -177,6 +168,14 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError
177168 return nil
178169 }
179170 }
171+ if ! a .ClusterStateRegistry .IsClusterHealthy () {
172+ glog .Warning ("Cluster is not ready for autoscaling" )
173+ scaleDown .CleanUpUnneededNodes ()
174+ return nil
175+ }
176+
177+ metrics .UpdateDurationFromStart (metrics .UpdateState , runStart )
178+ metrics .UpdateLastTime (metrics .Autoscaling , time .Now ())
180179
181180 // Check if there has been a constant difference between the number of nodes in k8s and
182181 // the number of nodes on the cloud provider side.
You can’t perform that action at this time.
0 commit comments