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

Commit

Permalink
Cluster autoscaler: add handlign for nill mig configs (in case not al…
Browse files Browse the repository at this point in the history
…l node pools are autoscaled)
  • Loading branch information
mwielgus committed Jun 30, 2016
1 parent 4b0c1c9 commit 27271cc
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 27271cc

Please sign in to comment.