Skip to content

Fix nil pointer panic in getDesiredEndpoints - #354

Closed
kvaps wants to merge 1 commit into
kubevirt:mainfrom
kvaps:fix/panic
Closed

kvaps wants to merge 1 commit into
kubevirt:mainfrom
kvaps:fix/panic

Conversation

@kvaps

@kvaps kvaps commented Jun 11, 2025 •

Copy link
Copy Markdown
Member

This PR addresses a potential panic in getDesiredEndpoints caused by dereferencing a nil NodeName field in EndpointSlice. The function now explicitly:

  • Skips EndpointSlice.Endpoints with NodeName == nil
  • Skips VMIs with empty Status.NodeName
  • Skips VMIs with missing interface IPs

Additionally, a focused unit test has been added to validate correct handling of these edge cases.

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jun 11, 2025
kvaps added a commit to cozystack/cozystack that referenced this pull request Jun 11, 2025
Fixes panic, upstream issue:

- kubevirt/cloud-provider-kubevirt#354

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved filtering and error handling for endpoints and virtual
machines with missing or invalid data, ensuring only valid endpoints are
processed.
- **New Features**
- Enhanced support for multi-cluster environments by introducing cluster
name filtering for service and endpoint management.
- **Tests**
- Added new tests to verify correct handling of endpoints and services
across clusters and improved coverage for edge cases.
- **Chores**
- Updated Kubernetes app and image versions for improved tracking and
deployment consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@kubevirt-bot

Copy link
Copy Markdown
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 9, 2025
@kubevirt-bot

Copy link
Copy Markdown
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

@kubevirt-bot kubevirt-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 9, 2025
@kubevirt-bot

Copy link
Copy Markdown
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@kubevirt-bot

Copy link
Copy Markdown
Contributor

@kubevirt-bot: Closed this PR.

Details

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

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.

@kvaps

kvaps commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

/reopen

@kubevirt-bot kubevirt-bot reopened this Dec 16, 2025
@kubevirt-bot

Copy link
Copy Markdown
Contributor

@kvaps: Reopened this PR.

Details

In response to this:

/reopen

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.

@kubevirt-bot

Copy link
Copy Markdown
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@kubevirt-bot

Copy link
Copy Markdown
Contributor

@kubevirt-bot: Closed this PR.

Details

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

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.

@kubevirt-bot

Copy link
Copy Markdown
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@kvaps

kvaps commented Feb 23, 2026

Copy link
Copy Markdown
Member Author

/reopen

@kubevirt-bot kubevirt-bot reopened this Feb 23, 2026
@kubevirt-bot

Copy link
Copy Markdown
Contributor

@kvaps: Reopened this PR.

Details

In response to this:

/reopen

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.

@kubevirt-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nunnatsa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kubevirt-bot

Copy link
Copy Markdown
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@kubevirt-bot

Copy link
Copy Markdown
Contributor

@kubevirt-bot: Closed this PR.

Details

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants