File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
cluster-autoscaler/clusterstate Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,16 @@ func (csr *ClusterStateRegistry) MaxNodeProvisionTime(nodeGroup cloudprovider.No
204
204
return csr .nodeGroupConfigProcessor .GetMaxNodeProvisionTime (nodeGroup )
205
205
}
206
206
207
+ // NodeGroupScaleUpTime returns the start time of the most recent scale-up request for the given node group.
208
+ func (csr * ClusterStateRegistry ) NodeGroupScaleUpTime (nodeGroup cloudprovider.NodeGroup ) (time.Time , error ) {
209
+ // NOTE: Don't remove. This is used by providers who import CA as a framework/library.
210
+ scaleUpRequest , found := csr .scaleUpRequests [nodeGroup .Id ()]
211
+ if ! found {
212
+ return time.Time {}, fmt .Errorf ("failed to find scaleUpRequest for node group: %s" , nodeGroup .Id ())
213
+ }
214
+ return scaleUpRequest .Time , nil
215
+ }
216
+
207
217
func (csr * ClusterStateRegistry ) registerOrUpdateScaleUpNoLock (nodeGroup cloudprovider.NodeGroup , delta int , currentTime time.Time ) {
208
218
maxNodeProvisionTime , err := csr .MaxNodeProvisionTime (nodeGroup )
209
219
if err != nil {
You can’t perform that action at this time.
0 commit comments