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

Incorrect cheat sheet entry: List all warning Events #40683

Closed
ehmad11 opened this issue Apr 14, 2023 · 7 comments
Closed

Incorrect cheat sheet entry: List all warning Events #40683

ehmad11 opened this issue Apr 14, 2023 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@ehmad11
Copy link

ehmad11 commented Apr 14, 2023

This is a Bug Report

Problem:
In the cheat sheet page, following command is suggested to list all warning events:

kubectl events --types=Warning

I get this error when I run this command

error: unknown command "events" for "kubectl"

Proposed Solution:

I think it should be replaced by following:

kubectl get events --field-selector type=Warning

Page to Update:
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-and-finding-resources

Kubernetes Version: v1.26.1

@ehmad11 ehmad11 added the kind/bug Categorizes issue or PR as related to a bug. label Apr 14, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 14, 2023
@sftim
Copy link
Contributor

sftim commented Apr 14, 2023

/triage accepted
/language en

Thanks for reporting this!
/help

How about we document kubectl get events --field-selector type=Warning --all-namespaces? A reader ought to be able to guess what the single-namespace version of that would look like.

/retitle Incorrect cheat sheet entry: List all warning Events

@k8s-ci-robot k8s-ci-robot changed the title List all warning events Incorrect cheat sheet entry: List all warning Events Apr 14, 2023
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. language/en Issues or PRs related to English language and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 14, 2023
@dipesh-rawat
Copy link
Member

kubectl events --types=Warning

The above commands works for me on v1.27. But agree with suggestion #40683 (comment) to provide an example having the mention of namespace to get some useful output instead of No events found in default namespace. (in most cases).

@ehmad11
Copy link
Author

ehmad11 commented Apr 14, 2023

kubectl events --types=Warning

The above commands works for me on v1.27. But agree with suggestion #40683 (comment) to provide an example having the mention of namespace to get some useful output instead of No events found in default namespace. (in most cases).

It would be helpful if compatibility information for specific versions is clearly stated and a separate page for events should be added similar to other API resources. Also, v.1.27 is just released and even the AWS EKS doesn't support it yet.

@sftim
Copy link
Contributor

sftim commented Apr 14, 2023

/remove-triage accepted

Oops. I tested with an old kubectl version.

We don't provide compatibility information for each subcommand of kubectl. If someone would like to maintain that information (and commit to keeping it maintained), the help will be appreciated - but it's a big undertaking.

We could add a comment to that line to mention that older kubectl versions don't provide this subcommand.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Apr 14, 2023
@sftim
Copy link
Contributor

sftim commented Apr 14, 2023

/remove-help

@k8s-ci-robot k8s-ci-robot removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 14, 2023
@dipesh-rawat
Copy link
Member

The problem appears to be identical to #40582 and may be a duplicate. It seems that people are having trouble with the kubectl events command in the cheatsheet. Perhaps it would be beneficial to temporarily include version information with the events command.

Refer: kubectl events enhancement

@ehmad11
Copy link
Author

ehmad11 commented Apr 16, 2023

I am closing the ticket as there is already version selection drop down at top right menu bar where you can select a version and it will provide commands specific to that version :)

@ehmad11 ehmad11 closed this as completed Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants