* Basic scaffolding for kubectl events command * Simple implementation of 'kubectl events' * Print event fields Borrowing code from 'kubectl describe' * Sort events before printing * Make output more like 'kubectl get events' Print namespace if fetching from all * Refactor: extract print functions To make it easier to add watch function next. * Implement watch for new events Run the list function same as before, so those events come out in order, then watch from the ResourceVersion after the last event. * Clear up some lint warnings * Update description and example text * refactor: introduce a listOptions variable * Implement --for option splitResourceTypeName() function borrowed from cli-runtime because we need similar behaviour to Builder.ResourceNames(), but applying to Event.InvolvedObject. * Add kubectl/pkg/cmd/events to vendor/modules.txt * Add back cmdutil.Factory Needed in NewCmdAlpha to construct the 'events' command Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Fix lint Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Make package alias go-cromulent Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Use genericclioptions.RESTClientGetter instead of cmdutil.Factory Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Decode object parameter to GroupVersionKind and name Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Merge two files into one Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Include example for --for option Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Fix inconsistent option name in error message Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Remove unnecessary Validate call Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Use fields from event series Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Support chunking of list of events Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Use watchtools utility to receive watch events Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Split struct into flags and options 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> * Add some parameters to usage string Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Do only one of list or watch 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> * Print message if no events found Also, if watching, don't print the headings until the first event arrives. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> Kubernetes-commit: a988182f595af64bc007ba9162509e089c36fd89 |
||
|---|---|---|
| .github | ||
| docs | ||
| images | ||
| pkg | ||
| testdata | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| OWNERS | ||
| README.md | ||
| SECURITY_CONTACTS | ||
| code-of-conduct.md | ||
| doc.go | ||
| go.mod | ||
| go.sum | ||
README.md
Kubectl
The k8s.io/kubectl repo is used to track issues for the kubectl cli distributed
with k8s.io/kubernetes. It also contains packages intended for use by client
programs. E.g. these packages are vendored into k8s.io/kubernetes for use in
the kubectl
cli client. That client will eventually move here too.
Contribution Requirements
-
Full unit-test coverage.
-
Go tools compliant (
go get,go test, etc.). It needs to be vendorable somewhere else. -
No dependence on
k8s.io/kubernetes. Dependence on other repositories is fine. -
Code must be usefully commented. Not only for developers on the project, but also for external users of these packages.
-
When reviewing PRs, you are encouraged to use Golang's code review comments page.
-
Packages in this repository should aspire to implement sensible, small interfaces and import a limited set of dependencies.
Community, discussion, contribution, and support
See this document for how to reach the maintainers of this project.
Code of conduct
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.
