-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix node event (/node/{name}/event) can not get the whole node event #6649
Conversation
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
Welcome @SihengCui! |
|
b3e8f07
to
b6693f2
Compare
CLA signed |
It is a natural way to use |
I am wondering if keeping an empty UID won't result in getting event information from the unrelated (similar) nodes. It might be better to first try with the UID and if it will return an empty result then retry with UID set to |
In my test environment, there are 9 node events at that time. 8 of them involvedObject.uid (from kubelte) are node_name , and 1 of them is node_uid. Is it necessary to search with uid first (1 result) and then search with nodename (8 results)? finally list append the results. If uid="", just use involvedObject.name=node.name to search. Theoretically, the node name of k8s is uniquely. But I dont know if there are risks elsewhere. |
If so, you have to find twice. XD kubernetes/pull/106485He also provided a similar method to solve this problem |
@floreks Some new work was submitted. |
Can you elaborate? Will it be fixed on the K8S core side or what? |
@floreks The original logic of the k8s dashboard is to query the node info first, and directly apply it to the query conditions of the node event. In this way, a part of the node event is lost, which In this PR, the two cases were queried separately in dashborad. Then integrate them. So the return of node event is complete. |
Codecov Report
@@ Coverage Diff @@
## master #6649 +/- ##
=======================================
Coverage 41.89% 41.89%
=======================================
Files 44 44
Lines 1234 1234
Branches 163 163
=======================================
Hits 517 517
Misses 717 717 |
Please fix the CI ( |
@floreks Sorry. I clicked the reset review by mistake. Also, please describe Fix CI in detail. This is my first submission and I am not very familiar with the process. |
I have changed the go imports order to fix the CI. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: floreks, SihengCui The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Using the kubectl command, I can get the node event like this:
However, on the dashboard, I cannot view any node events.
The reason of such problem is that, the k8s dashboard transmits
node.UID
to client-go for selection the involvedObject.uid of node event.Kubectl kubectl(describe node), it use
ref.UID=node.name
for searching.In kubernetes/kubernetes/issues/100236 , he reported a bug. That, the involvedObject.uid of node event may be node_uid or node_name.
So I set the uid of the search reference to
""
. It will not use involvedObject.uid to searching the node event, so that we can get the whole node event to handel both cases.