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
'kubectl events' command #99557
'kubectl events' command #99557
Conversation
@soltysh could I ask for some feedback please on the overall approach |
/cc |
Borrowing code from 'kubectl describe'
Print namespace if fetching from all
To make it easier to add watch function next.
Run the list function same as before, so those events come out in order, then watch from the ResourceVersion after the last event.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Flags represents the inputs from the CLI; options are what the running command needs. This structure parallels the 'wait' command, and should be easier to write tests for. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One final nit and this is good to go.
/triage accepted |
We tried to print the list first then start a watch after the last event, but sometimes the server will return "watch is too old" on that ResourceVersion. Instead, if we need to watch just start it from the beginning. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Also, if watching, don't print the headings until the first event arrives. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
daecfb0
to
f215193
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/label tide/merge-method-squash
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bboreham, 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 |
Some ideas for further enhancements:
|
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a new verb 'events' to
kubectl
which addresses various deficiencies withkubectl get events
.Which issue(s) this PR fixes:
kubernetes/enhancements#1440
Fixes: kubernetes/kubectl#704
Fixes: #29838
Special notes for your reviewer:
This is a very minimal version, posted to see if I'm on the right track.
In particular, it does not implement any flexibility on output formats.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Video of KubeCon talk "The Soul of a New Command: Adding ‘Events’ to kubectl"