Skip to content

[release-0.11] Bug fix: use guest node name when draining node on VM eviction - #375

Closed
nunnatsa wants to merge 7 commits into
kubernetes-sigs:mainfrom
nunnatsa:r0.11-fix-drain-guest-node-name
Closed

nunnatsa wants to merge 7 commits into
kubernetes-sigs:mainfrom
nunnatsa:r0.11-fix-drain-guest-node-name

Conversation

@nunnatsa

@nunnatsa nunnatsa commented Feb 26, 2026 •

Copy link
Copy Markdown
Contributor

Opened by mistake

nunnatsa and others added 7 commits January 8, 2026 11:17
Going back to v1beta1

Signed-off-by: Nahshon Unna Tsameret <nahsh.ut@gmail.com>
…capi-api-to-beta1

Revert moving to claster-api v1beta2
Add support for exposing all IP addresses (IPv4 and IPv6) in the
KubevirtMachine status instead of just the primary IP. This fixes
CSR auto-approval on dual-stack hosted control plane clusters where
the machine-approver needs to see both IPv4 and IPv6 addresses.

Changes:
- Add Addresses() method to MachineInterface to retrieve all IPs
  from all VMI network interfaces
- Update controller to populate multiple InternalIP and ExternalIP
  entries for each address
- Add unit tests for dual-stack address handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
[release-0.11] Expose dual-stack addresses in KubevirtMachine status
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>
…ction

Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 26, 2026
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 26, 2026
@nunnatsa nunnatsa closed this Feb 26, 2026
@nunnatsa
nunnatsa deleted the r0.11-fix-drain-guest-node-name branch February 26, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants