kubernetes/vendor
Bryan Boreham a988182f59
'kubectl events' command (#99557)
* 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>
2021-10-29 09:12:50 -07:00
..
bitbucket.org/bertimus9/systemstat hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
cloud.google.com/go upgrade github.com/prometheus/common to v0.28.0 2021-07-12 10:57:24 +08:00
github.com upgrade github.com/evanphx/json-patch to v4.12.0 2021-10-26 11:20:45 +08:00
go.etcd.io Drop etcd tests dependency 2021-06-23 10:22:58 -04:00
go.opencensus.io upgrade google.golang.org/api to v0.45.0 2021-07-12 11:33:22 +08:00
go.opentelemetry.io Add distributed tracing to the apiserver using OpenTelemetry 2021-06-25 05:20:27 -07:00
go.starlark.net until stable: pin-dependency, update-vendor, update-bazel, lint-dep 2021-03-08 16:50:43 -08:00
go.uber.org klog 2.20.0, logr v1.1.0, zapr v1.1.0 2021-09-09 14:43:43 +02:00
golang.org/x generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh 2021-08-24 15:47:47 -04:00
gonum.org/v1/gonum hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
google.golang.org fix test failures in legacy cloud provider: add 'projects/' after upgrade 2021-07-13 12:42:23 +08:00
gopkg.in Update protobuf,grpc,etcd dependencies 2021-06-15 10:06:09 -04:00
k8s.io klog 2.30.0, logr 1.2.0, zapr 1.2.0 2021-10-22 15:32:20 +02:00
sigs.k8s.io vendor sigs.k8s.io/json 2021-10-20 13:12:08 -04:00
modules.txt 'kubectl events' command (#99557) 2021-10-29 09:12:50 -07:00
OWNERS Add myself as a dep reviewer 2021-04-30 07:59:19 -07:00