Skip to content
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 Kubectl describe node missing event #106485

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

aimuz
Copy link
Contributor

@aimuz aimuz commented Nov 17, 2021

Kubectl describe node ignores the node events created by the controller

#106475

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 17, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @aimuz. Thanks for your PR.

I'm waiting for a kubernetes 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.

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.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 17, 2021
@aimuz
Copy link
Contributor Author

aimuz commented Nov 17, 2021

/assign @janetkuo

@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 17, 2021
@aimuz
Copy link
Contributor Author

aimuz commented Nov 17, 2021

/sig cli

@eddiezane
Copy link
Member

Can you please add a test that helps make clear why we need this and why this is the correct fix?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 18, 2021
@aimuz
Copy link
Contributor Author

aimuz commented Dec 18, 2021

Can you please add a test that helps make clear why we need this and why this is the correct fix?

Test cases have been added

@janetkuo
Copy link
Member

/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 Dec 21, 2021
@janetkuo
Copy link
Member

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Dec 21, 2021
@dims
Copy link
Member

dims commented Jan 6, 2022

/assign @eddiezane

Copy link
Member

@eddiezane eddiezane left a comment

Choose a reason for hiding this comment

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

Thanks for adding a test. I apologize but I still don't understand this change. Can you please help me understand?

Type Reason Age From Message
---- ------ ---- ---- -------
Normal 7y342d Node bar status is now: NodeHasNoDiskPressure
Normal 7y342d (x2 over 7y342d) Node bar status is now: NodeReady
Copy link
Member

Choose a reason for hiding this comment

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

This test now fails because the date is different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test now fails because the date is different.

I reworked the test cases

@aimuz
Copy link
Contributor Author

aimuz commented Jan 7, 2022

Can you please help me understand?

@eddiezane

This test case is to test that both nodename as event uid and node.uid as event uid can be displayed by kubectl describe node.

I will fix this test case so that it can be tested at any time

@derekwaynecarr
Copy link
Member

I have trouble understanding the problem being solved and the impact of the fix.

Is it easy to demonstrate via a test case?

@derekwaynecarr
Copy link
Member

/assign

@pacoxu
Copy link
Member

pacoxu commented Jan 10, 2022

#100847 tried to fix the problem in kubelet side #100236.
#100236 is clearer for the problem that @aimuz met.

@aimuz
Copy link
Contributor Author

aimuz commented Jan 10, 2022

@derekwaynecarr

#100847 tried to fix the problem in kubelet side #100236.
#100236 is clearer for the problem that @aimuz met.

@aimuz aimuz requested a review from eddiezane January 10, 2022 07:42
// there are two UIDs for host events:
// controller use node.uid
// kubelet use node.name
ref.UID = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

If the discrepancy is in the kubelet which is injecting name into UID that should be fixed on the kubelet side of things. What I'm willing to accept on the kubectl side of things are 2 searchEvents calls one using UID and other using name such that we'll scrape both events and leave a TODO here pointing to issue against kubelet, such that we'll be able to remove the workaround after kubelet is fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@soltysh
I have a question, by what field are the events sorted, as the merge needs to combine them and reorder them, is it the creation time field?

Kubectl describe node ignores the node events created by the controller
kubernetes#106475
@aimuz
Copy link
Contributor Author

aimuz commented Mar 9, 2022

/test pull-kubernetes-integration

Copy link
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.

/lgtm
/approve
/triage accepted
/priority backlog

// there are two UIDs for host events:
// controller use node.uid
// kubelet use node.name
// TODO: Uniform use of UID
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: would be nice to point to a specific issue number tracking this problem.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aimuz, soltysh

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 /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 Mar 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit 4d45ae5 into kubernetes:master Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 28, 2022
@aimuz aimuz deleted the fix-kubectl-uid branch March 28, 2022 15:58
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. 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. 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. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. 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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants