Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CA 1.29 #6677 cherry-pick] fix: scale up broken for providers not implementing NodeGroup.GetOptions() #6761

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
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/cloud_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ type NodeGroup interface {

// GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular
// NodeGroup. Returning a nil will result in using default options.
// Implementation optional.
// Implementation optional. Callers MUST handle `cloudprovider.ErrNotImplemented`.
GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
}

Expand Down
6 changes: 3 additions & 3 deletions cluster-autoscaler/core/scaleup/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func (o *ScaleUpOrchestrator) filterValidScaleUpNodeGroups(
continue
}
autoscalingOptions, err := nodeGroup.GetOptions(o.autoscalingContext.NodeGroupDefaults)
if err != nil {
if err != nil && err != cloudprovider.ErrNotImplemented {
klog.Errorf("Couldn't get autoscaling options for ng: %v", nodeGroup.Id())
}
numNodes := 1
Expand Down Expand Up @@ -499,7 +499,7 @@ func (o *ScaleUpOrchestrator) ComputeExpansionOption(
metrics.UpdateDurationFromStart(metrics.Estimate, estimateStart)

autoscalingOptions, err := nodeGroup.GetOptions(o.autoscalingContext.NodeGroupDefaults)
if err != nil {
if err != nil && err != cloudprovider.ErrNotImplemented {
klog.Errorf("Failed to get autoscaling options for node group %s: %v", nodeGroup.Id(), err)
}
if autoscalingOptions != nil && autoscalingOptions.ZeroOrMaxNodeScaling {
Expand Down Expand Up @@ -639,7 +639,7 @@ func (o *ScaleUpOrchestrator) ComputeSimilarNodeGroups(
}

autoscalingOptions, err := nodeGroup.GetOptions(o.autoscalingContext.NodeGroupDefaults)
if err != nil {
if err != nil && err != cloudprovider.ErrNotImplemented {
klog.Errorf("Failed to get autoscaling options for node group %s: %v", nodeGroup.Id(), err)
}
if autoscalingOptions != nil && autoscalingOptions.ZeroOrMaxNodeScaling {
Expand Down
4 changes: 2 additions & 2 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ func (a *StaticAutoscaler) removeOldUnregisteredNodes(allUnregisteredNodes []clu
nodesToDelete := toNodes(unregisteredNodesToDelete)

opts, err := nodeGroup.GetOptions(a.NodeGroupDefaults)
if err != nil {
if err != nil && err != cloudprovider.ErrNotImplemented {
klog.Warningf("Failed to get node group options for %s: %s", nodeGroupId, err)
continue
}
Expand Down Expand Up @@ -858,7 +858,7 @@ func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() (bool, error) {
} else {
var opts *config.NodeGroupAutoscalingOptions
opts, err = nodeGroup.GetOptions(a.NodeGroupDefaults)
if err != nil {
if err != nil && err != cloudprovider.ErrNotImplemented {
klog.Warningf("Failed to get node group options for %s: %s", nodeGroupId, err)
continue
}
Expand Down
Loading