Skip to content

Commit

Permalink
Merge pull request #1175 from aleksandra-malinowska/refactor-cp-fix-2
Browse files Browse the repository at this point in the history
Fix fetching resource limits on GKE
  • Loading branch information
aleksandra-malinowska authored Aug 22, 2018
2 parents 613f223 + dcd6968 commit 09590de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func (m *autoscalingGkeClientV1beta1) FetchResourceLimits() (*cloudprovider.Reso
return nil, err
}
if cluster.Autoscaling == nil {
glog.Warningf("FetchResourceLimits called without autoscaling limits set")
return nil, nil
}

Expand Down
10 changes: 7 additions & 3 deletions cluster-autoscaler/cloudprovider/gke/gke_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,13 @@ func (m *gkeManagerImpl) fetchResourceLimiter() error {
if err != nil {
return err
}

glog.V(2).Infof("Refreshed resource limits: %s", resourceLimiter.String())
m.cache.SetResourceLimiter(resourceLimiter)
if resourceLimiter != nil {
glog.V(2).Infof("Refreshed resource limits: %s", resourceLimiter.String())
m.cache.SetResourceLimiter(resourceLimiter)
} else {
oldLimits, _ := m.cache.GetResourceLimiter()
glog.Errorf("Resource limits should always be defined in NAP mode, but they appear to be empty. Using possibly outdated limits: %v", oldLimits.String())
}
}
return nil
}
Expand Down

0 comments on commit 09590de

Please sign in to comment.