-
Notifications
You must be signed in to change notification settings - Fork 26
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
Avoids panics when VM type isn't found during scale from zero #77
Avoids panics when VM type isn't found during scale from zero #77
Conversation
- Cluster autoscaler was trying to fetch VM details for AWS VMs instead of required Azure VMs for MCM (OOT) provider Azure. This lead to panics. Now, it fetches the details from the correct provider VM map. - This PR also improves error handling in such scenarios to not panic.
/invite @AxiomSamarth @ialidzhikov |
@@ -681,8 +690,10 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine | |||
if err != nil { | |||
return nil, fmt.Errorf("Unable to convert from %s to %s for %s, Error: %v", kindMachineClass, providerAzure, machinedeployment.Name, err) | |||
} | |||
|
|||
azureInstance := aws.InstanceTypes[providerSpec.Properties.HardwareProfile.VMSize] | |||
azureInstance, exists := azure.InstanceTypes[providerSpec.Properties.HardwareProfile.VMSize] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key change causing the panic is here, where it was fetching AWS details for Azure VMs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@prashanth26 , can you please file a cherry-pick and cut a |
Yes, on it. Thanks. |
Also tested this change locally. Scale from zero seems to work as before/expected now. No more panics.
|
…er#77) - Cluster autoscaler was trying to fetch VM details for AWS VMs instead of required Azure VMs for MCM (OOT) provider Azure. This lead to panics. Now, it fetches the details from the correct provider VM map. - This PR also improves error handling in such scenarios to not panic.
…er#77) - Cluster autoscaler was trying to fetch VM details for AWS VMs instead of required Azure VMs for MCM (OOT) provider Azure. This lead to panics. Now, it fetches the details from the correct provider VM map. - This PR also improves error handling in such scenarios to not panic.
) - Cluster autoscaler was trying to fetch VM details for AWS VMs instead of required Azure VMs for MCM (OOT) provider Azure. This lead to panics. Now, it fetches the details from the correct provider VM map. - This PR also improves error handling in such scenarios to not panic. Co-authored-by: Prashanth <prashanth@sap.com>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #76
Special notes for your reviewer:
Release note: