Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1301 from mwielgus/add-null-handling-for-migconfigs
Browse files Browse the repository at this point in the history
Cluster autoscaler: add handlign for nill mig configs (in case not all l node pools are autoscaled)
  • Loading branch information
mwielgus authored Jul 1, 2016
2 parents 8a64595 + 27271cc commit e2a8815
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cluster-autoscaler/scale_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ func ScaleDown(
glog.Errorf("Error while checking mig config for instance %v: %v", instance, err)
continue
}
if migConfig == nil {
glog.V(4).Infof("Skipping %s - no mig config", node.Name)
continue
}

size, err := gceManager.GetMigSize(migConfig)
if err != nil {
glog.Errorf("Error while checking mig size for instance %v: %v", instance, err)
Expand Down
3 changes: 3 additions & 0 deletions cluster-autoscaler/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ func GetNodeInfosForMigs(nodes []*kube_api.Node, gceManager *gce.GceManager, kub
if err != nil {
return map[string]*schedulercache.NodeInfo{}, err
}
if migConfig == nil {
continue
}
url := migConfig.Url()

nodeInfo, err := simulator.BuildNodeInfoForNode(node, kubeClient)
Expand Down

0 comments on commit e2a8815

Please sign in to comment.