Skip to content

Commit

Permalink
Use a single log line in GCE refresh to more accurately represent the…
Browse files Browse the repository at this point in the history
… next refresh
  • Loading branch information
Nic Cope committed Dec 1, 2017
1 parent 29eddc3 commit 7223092
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cluster-autoscaler/cloudprovider/gce/gce_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,29 +825,26 @@ func (m *gceManagerImpl) Refresh() error {
}

func (m *gceManagerImpl) forceRefresh() error {
nextRefreshAfter := time.Now().Add(refreshInterval)
switch m.mode {
case ModeGCE:
if err := m.fetchAutoMigs(); err != nil {
glog.Errorf("Failed to fetch MIGs: %v", err)
return err
}
glog.V(2).Infof("Refreshed MIG list, next refresh after %v", nextRefreshAfter)
case ModeGKENAP:
if err := m.fetchResourceLimiter(); err != nil {
glog.Errorf("Failed to fetch resource limits: %v", err)
return err
}
glog.V(2).Infof("Refreshed resource limits, next refresh after %v", nextRefreshAfter)
fallthrough
case ModeGKE:
if err := m.fetchAllNodePools(); err != nil {
glog.Errorf("Failed to fetch node pools: %v", err)
return err
}
glog.V(2).Infof("Refreshed NodePool list, next refresh after %v", nextRefreshAfter)
}
m.lastRefresh = time.Now()
glog.V(2).Infof("Refreshed GCE resources, next refresh after %v", m.lastRefresh.Add(refreshInterval))
return nil
}

Expand Down

0 comments on commit 7223092

Please sign in to comment.