fix: include node events with null involvedObject.uid in describe output#1840
fix: include node events with null involvedObject.uid in describe output#1840vigneshakaviki wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
|
|
Welcome @vigneshakaviki! |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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 |
Verified end-to-end on a local minikube clusterSetup: Created a test event with 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 {"apiVersion": "v1", "kind": "Node", "name": "minikube"}Stock kubectl — event is missing: Patched kubectl (built with this PR's changes) — event is shown: |
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>
e9b68ff to
e976d59
Compare
soltysh
left a comment
There was a problem hiding this comment.
/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
|
@soltysh: Closed this PR. DetailsIn response to this:
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. |
|
Reopened at kubernetes/kubernetes#138362 per @soltysh's direction. Thanks for the pointer! |
What type of PR is this?
/kind bug
What this PR does / why we need it
kubectl describe nodeomits events whereinvolvedObject.uidis unset/null. This happens with kubelet-emitted node status events on some clusters (e.g. EKS), where kubelet creates events withinvolvedObject.uid: nullbut validinvolvedObject.kind=NodeandinvolvedObject.name=<node>.Currently
NodeDescriber.Describe()searches for events using two UIDs:Neither matches events where
involvedObject.uidis 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?