Skip to content

fix: include node events with null involvedObject.uid in describe output#1840

Closed
vigneshakaviki wants to merge 1 commit intokubernetes:masterfrom
vigneshakaviki:fix/describe-node-events-null-uid
Closed

fix: include node events with null involvedObject.uid in describe output#1840
vigneshakaviki wants to merge 1 commit intokubernetes:masterfrom
vigneshakaviki:fix/describe-node-events-null-uid

Conversation

@vigneshakaviki
Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it

kubectl describe node omits events where involvedObject.uid is unset/null. This happens with kubelet-emitted node status events on some clusters (e.g. EKS), where kubelet creates events with involvedObject.uid: null but valid involvedObject.kind=Node and involvedObject.name=<node>.

Currently NodeDescriber.Describe() searches for events using two UIDs:

  1. The node's real UID (for controller events)
  2. The node name as UID (for kubelet events using the name workaround)

Neither matches events where involvedObject.uid is null/empty.

How does this PR fix it

Adds a third search with empty UID (matching by kind+name only) and deduplicates the merged results using event UIDs to avoid showing duplicate entries.

Which issue(s) this PR fixes

Fixes #1838

Does this PR introduce a user-facing change?

Fixed kubectl describe node to show events where involvedObject.uid is null, such as kubelet-emitted node status events on some clusters.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. kind/bug Categorizes issue or PR as related to a bug. labels Apr 13, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 13, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vigneshakaviki / name: vigneshakaviki (e976d59)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @vigneshakaviki!

It looks like this is your first PR to kubernetes/kubectl 🎉. 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/kubectl 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 cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 13, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vigneshakaviki

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

@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 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 13, 2026
@vigneshakaviki
Copy link
Copy Markdown
Author

Hi @marinoborges, I took a shot at fixing this. The approach adds a third event search with an empty UID (matching by kind+name only) alongside the existing two searches (real UID and name-as-UID), then deduplicates the merged results.

Could a sig/cli reviewer take a look and let me know if this approach is reasonable? Happy to adjust if there's a preferred way to handle this.

/cc @soltysh

@k8s-ci-robot k8s-ci-robot requested a review from soltysh April 13, 2026 17:16
@vigneshakaviki
Copy link
Copy Markdown
Author

Verified end-to-end on a local minikube cluster

Setup: Created a test event with involvedObject.uid unset:

apiVersion: v1
kind: Event
metadata:
  name: test-null-uid-event
  namespace: default
involvedObject:
  apiVersion: v1
  kind: Node
  name: minikube
type: Warning
reason: TestNullUID
message: "This is a test event with null involvedObject.uid"

Confirmed involvedObject has no uid field:

{"apiVersion": "v1", "kind": "Node", "name": "minikube"}

Stock kubectl — event is missing:

$ kubectl describe node minikube | grep TestNullUID
(no output — bug confirmed)

Patched kubectl (built with this PR's changes) — event is shown:

$ ./kubectl-patched describe node minikube
Events:
  Type     Reason                   Age                  From             Message
  ----     ------                   ----                 ----             -------
  Normal   Starting                 110s                 kube-proxy       
  Warning  TestNullUID              17h                                   This is a test event with null involvedObject.uid
  Normal   Starting                 115s                 kubelet          Starting kubelet.
  Normal   NodeHasSufficientMemory  115s (x8 over 115s)  kubelet          Node minikube status is now: NodeHasSufficientMemory
  ...

kubectl describe node omits events where involvedObject.uid is
unset/null. This happens with kubelet-emitted node status events
on some clusters (e.g. EKS).

NodeDescriber.Describe() searched for events using two UIDs:
1. The node's real UID (for controller events)
2. The node name as UID (for kubelet events using name workaround)

Neither matched events where involvedObject.uid is null/empty.

Add a third search with empty UID (matching by kind+name only)
and deduplicate the merged results to avoid showing duplicates.

Ref: kubernetes/issues/1838

Signed-off-by: vigneshakaviki <kumarvignesh295@gmail.com>
@vigneshakaviki vigneshakaviki force-pushed the fix/describe-node-events-null-uid branch from e9b68ff to e976d59 Compare April 13, 2026 17:49
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@soltysh: Closed this PR.

Details

In response to this:

/close

@vigneshakaviki please open this PR against https://github.com/kubernetes/kubernetes/

This repository is only a read-only copy from https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/kubectl/. You can read more about it in https://github.com/kubernetes/kubectl/blob/master/README.md

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.

@vigneshakaviki
Copy link
Copy Markdown
Author

Reopened at kubernetes/kubernetes#138362 per @soltysh's direction. Thanks for the pointer!

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

Labels

area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kubectl describe node omits events when involvedObject.uid is null (kubelet-emitted node events are missing)

3 participants