diff --git a/cluster-autoscaler/cloudprovider/gke/autoscaling_gke_client_v1beta1.go b/cluster-autoscaler/cloudprovider/gke/autoscaling_gke_client_v1beta1.go index 815fda295df8..d4e0195fdafb 100644 --- a/cluster-autoscaler/cloudprovider/gke/autoscaling_gke_client_v1beta1.go +++ b/cluster-autoscaler/cloudprovider/gke/autoscaling_gke_client_v1beta1.go @@ -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 } diff --git a/cluster-autoscaler/cloudprovider/gke/gke_manager.go b/cluster-autoscaler/cloudprovider/gke/gke_manager.go index e855d11d8d52..d7fb95d12158 100644 --- a/cluster-autoscaler/cloudprovider/gke/gke_manager.go +++ b/cluster-autoscaler/cloudprovider/gke/gke_manager.go @@ -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 }