-
Notifications
You must be signed in to change notification settings - Fork 423
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
fix(machinepool): clear VirtualMachineProfile if no model/custom data update #5164
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @mweibel. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
06f39bd
to
19d3251
Compare
existingVMSS.Properties.AdditionalCapabilities = &armcompute.AdditionalCapabilities{UltraSSDEnabled: ptr.To(true)} | ||
|
||
clone := newDefaultExistingVMSS("VM_SIZE") | ||
clone.SKU.Capacity = ptr.To[int64](3) | ||
clone.Properties.AdditionalCapabilities = &armcompute.AdditionalCapabilities{UltraSSDEnabled: ptr.To(true)} | ||
clone.Properties.VirtualMachineProfile.NetworkProfile = nil | ||
|
||
clone.Properties.VirtualMachineProfile.StorageProfile.ImageReference.Version = ptr.To("2.0") | ||
clone.Properties.VirtualMachineProfile.NetworkProfile = nil |
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.
FYI those two lines I removed because they were duplicates.
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5164 +/- ##
=======================================
Coverage 51.35% 51.36%
=======================================
Files 273 273
Lines 24671 24676 +5
=======================================
+ Hits 12670 12675 +5
Misses 11212 11212
Partials 789 789 ☔ View full report in Codecov by Sentry. |
@@ -222,10 +222,8 @@ func (m *MachinePoolScope) ScaleSetSpec(ctx context.Context) azure.ResourceSpecG | |||
} | |||
|
|||
if m.cache != nil { | |||
if m.HasReplicasExternallyManaged(ctx) { | |||
spec.ShouldPatchCustomData = m.cache.HasBootstrapDataChanges |
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.
For my own understanding: why are we removing the check for m.HasReplicasExternallyManaged(ctx)
?
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.
further below in ScaleSetSpec#existingParameters
we determine whether we need to set VirtualMachineProfile
to nil
based on whether there are model changes or the ShouldPatchCustomData
flag is being set. This flag will now be used for all kind of autoscaling, not just externally managed. We don't know otherwise if the custom data changed or not (since, when fetching a VMSS, you don't receive the customData for security reasons).
… update Scale up/down with MachinePool always updates the VM image model to use. This change sets the VirtualMachineProfile to nil when no change is necessary and ensures therefore less churn on scale up/downs leading to model updates which may require manual fixing Fixes some linting errors related to unnecessary params, too.
19d3251
to
c8cf42a
Compare
/retest ^ looks like a flake |
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
/test all
LGTM label has been added. Git tree hash: 37ebd22eb8d86832791cd02014e08a101e29b9b4
|
/assign @nawazkh |
/test ls |
@nawazkh: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I will need some time understanding this change, I hope it is ok to hold for a day more. |
sure, take your time and let me know if there are questions. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Scale up/down with MachinePool always updates the VM image model to use. This change sets the VirtualMachineProfile to nil when no change is necessary and ensures therefore less churn on scale up/downs leading to model updates which may require manual fixing
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #4958
Special notes for your reviewer:
TODOs:
Release note: