-
Notifications
You must be signed in to change notification settings - Fork 300
Skip VMSS VM update when no matching disks found during detach operation #9798
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
Skip VMSS VM update when no matching disks found during detach operation #9798
Conversation
|
@landreasyan: The label(s) DetailsIn 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. |
|
/retest |
|
/retest |
|
@landreasyan: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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 understand the commands that are listed here. |
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.
Pull request overview
This PR optimizes the DetachDisk operation for VMSS by preventing unnecessary VM updates when no matching disks are found to detach. This avoids wasted API calls and prevents VMs from entering pending states during critical failures.
- Early return added when no disks match the detach request, skipping the VM update entirely
- Comprehensive test coverage for three scenarios: no disks on VM, single non-matching disk, and multiple non-matching disks
- Improved logging to clearly indicate when VM updates are skipped
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/provider/azure_controller_vmss.go | Added early return logic to skip VM update when no matching disks found, restructured control flow, and improved success/error logging |
| pkg/provider/azure_controller_vmss_test.go | Added test infrastructure (noDisksOnVM, skipUpdate flags) and three new test cases to verify VM update is correctly skipped when no matching disks exist |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andyzhangx
left a comment
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.
/kind cleanup
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, landreasyan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherrypick release-1.31 |
|
@landreasyan: #9798 failed to apply on top of branch "release-1.31": DetailsIn 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. |
|
/cherrypick release-1.32 |
|
/cherrypick release-1.33 |
|
@landreasyan: new pull request created: #9818 DetailsIn 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. |
|
@landreasyan: new pull request created: #9819 DetailsIn 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. |
|
/cherrypick release-1.34 |
|
@landreasyan: new pull request created: #9820 DetailsIn 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. |
What type of PR is this?
/kind improvement
What this PR does / why we need it:
This PR optimizes the VMSS DetachDisk operation by skipping unnecessary VM updates when no matching disks are found to detach. This can occur in two scenarios:
Previously, the code would proceed with a VM update even when no disks needed to be detached, which could lead to:
Changes made:
DetachDisk()when no matching disks are found, avoiding the VM update callWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: