Skip to content

nfd-master: fix panic on NodeFeature delete#2478

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
samsar:fix-2470-nfd-master-panic
Apr 10, 2026
Merged

nfd-master: fix panic on NodeFeature delete#2478
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
samsar:fix-2470-nfd-master-panic

Conversation

@samsar
Copy link
Copy Markdown
Contributor

@samsar samsar commented Apr 1, 2026

Fixes #2470

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 1, 2026

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 72658da
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-nfd/deploys/69d79bc22d048300083567c1
😎 Deploy Preview https://deploy-preview-2478--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 1, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: samsar / name: Saman Sartipi (72658da)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @samsar!

It looks like this is your first PR to kubernetes-sigs/node-feature-discovery 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/node-feature-discovery has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 1, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @samsar. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 1, 2026
Comment thread pkg/nfd-master/nfd-api-controller.go Outdated
klog.V(2).InfoS("found stale NodeFeatureGroup object", "object", obj)
obj = deletedFinalStateUnknown.Obj
}
nfg := obj.(*nfdv1alpha1.NodeFeatureGroup)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per your judgment: would something like pkg/nfd-gc/nfd-gc.go:131-134 be extra here (or that one alone would do).

Copy link
Copy Markdown
Contributor Author

@samsar samsar Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think this handler will always be called with the right object type, but I added the type assertion to both handlers just to be extra safe

Copy link
Copy Markdown
Contributor

@ozhuraki ozhuraki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this a good defensive delete handler pattern and I don't see an issue with it.
WDYT @marquiz

@fmuyassarov
Copy link
Copy Markdown
Member

One thing I would ask to do though is to squash the commits.

@samsar samsar force-pushed the fix-2470-nfd-master-panic branch 2 times, most recently from 2d5dcf8 to c2178d5 Compare April 9, 2026 12:29
Consolidate the panic fix and follow-up cleanup into a single change set with safer type assertions and clearer error logging.
@samsar samsar force-pushed the fix-2470-nfd-master-panic branch from c2178d5 to 72658da Compare April 9, 2026 12:29
@samsar
Copy link
Copy Markdown
Contributor Author

samsar commented Apr 9, 2026

One thing I would ask to do though is to squash the commits.

Done!

Copy link
Copy Markdown
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @samsar for the PR. Definitely a valuable fix for our sloppy code
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 10, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marquiz, ozhuraki, samsar

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2026
@marquiz
Copy link
Copy Markdown
Contributor

marquiz commented Apr 10, 2026

I think this a good defensive delete handler pattern and I don't see an issue with it.

Yes 👍

@marquiz
Copy link
Copy Markdown
Contributor

marquiz commented Apr 10, 2026

/cherry-pick release-0.18

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@marquiz: once the present PR merges, I will cherry-pick it on top of release-0.18 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-0.18

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.

@marquiz marquiz requested a review from fmuyassarov April 10, 2026 10:23
Copy link
Copy Markdown
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retitle nfd-master: fix panic on NodeFeature delete
/lgtm

@k8s-ci-robot k8s-ci-robot changed the title nfd-master: fix panic on NodeFeature delete (issue #2470) nfd-master: fix panic on NodeFeature delete Apr 10, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 10, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: a3bb4876bf98002ed4c9e7e1b708c0505c58db56

@k8s-ci-robot k8s-ci-robot merged commit 3cec0be into kubernetes-sigs:master Apr 10, 2026
10 checks passed
@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@marquiz: new pull request created: #2487

Details

In response to this:

/cherry-pick release-0.18

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

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nfd-master panics on NodeFeature/NodeFeatureGroup delete when informer watch is interrupted

6 participants