Bug fix: use guest node name when draining node on VM eviction - #374
Merged
k8s-ci-robot merged 3 commits intoFeb 25, 2026
Merged
Conversation
drainNode() was using vmiInstance.Status.EvacuationNodeName to look up the node in the guest cluster, but that field contains the host/infra node name. This caused the drain to silently fail with a NotFound error, meaning workloads were abruptly killed instead of being gracefully evicted. Use KubevirtMachine.Name instead, which is the guest node name, consistent with the rest of the codebase (e.g. updateNodeProviderID, GenerateProviderID). Update unit tests to use distinct values for the host node name and guest node name, so the bug cannot be masked again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The eviction e2e test only validated that the VMI was deleted and recreated, but did not check that the guest node was actually drained. Add an assertion that the guest node is marked unschedulable (cordoned) before the VMI finalizer is removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
/ok-to-test |
…ction Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
nunnatsa
force-pushed
the
fix-drain-guest-node-name
branch
from
February 25, 2026 12:02
a110d30 to
0f33c9c
Compare
Contributor
|
/lgtm |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nunnatsa, qinqon 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 |
Contributor
Author
|
/cherry-pick release-0.11 release-0.10 |
This was referenced Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
drainNode()was usingvmiInstance.Status.EvacuationNodeNameto look up the node in the guest cluster, but that field contains the host/infra node name.This caused the drain to silently fail with a NotFound error, meaning workloads were abruptly killed instead of being gracefully evicted.
Use
KubevirtMachine.Nameinstead, which is the guest node name, consistent with the rest of the codebase (e.g.updateNodeProviderID,GenerateProviderID).This PR fixes the issue described in https://issues.redhat.com/browse/OCPBUGS-66890
Release notes: