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

Cluster autoscaler: add handlign for nill mig configs (in case not all l node pools are autoscaled) #1301

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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