astefanutti / kubebox

⎈❏ Terminal and Web console for Kubernetes
http://astefanutti.github.io/kubebox
MIT License
2.14k stars 142 forks source link

Events Tab implementation #81

Closed johnpoth closed 4 years ago

johnpoth commented 4 years ago

This is a first stab at #36 to support events.

Hopefully we'll be able to reuse most of this for other resource types (via inheritance or composition).

We could also display a list of resource names similar to what we do for namespaces to support things like custom resources.

Once we agree on the display I'll polish things up a bit :)

HTH !

Note: I had to modify lib/ui/blessed/element.js for performance reasons.

astefanutti commented 4 years ago

I've just re-tested it and got the following issue:

Screenshot 2020-03-02 at 18 32 00

I open the event tab. Then the events display correctly. I trigger an event. like scaling a deployment, then the new events display with undefined.

johnpoth commented 4 years ago

I've tried to reproduce scaling deployments up and down without any luck. I'm wondering if this is specific to kamel-k that creates events but doesn't populate some standard fields (like namespace).

Out of curiosity, could you run describe on one of those events ? I'm pretty sure some fields are undefined which is what causes the rendering issues.

johnpoth commented 4 years ago

I think this raises an important case in that some fields aren't necessarily populated. As this will also be relevant in other Kubernetes Resources, I thought it would be okay to add a check in the listable and table blessed Prototypes. Added relevant commit. Thanks !

astefanutti commented 4 years ago

Awesome. Did you get a change to look at the status bar not displaying? Otherwise I think we can merge the PR and have a look afterwards.

astefanutti commented 4 years ago

Note to myself, check how sorting is implemented in:

$ kubectl get events --sort-by=.metadata.creationTimestamp
astefanutti commented 4 years ago

Let me resolve the conflicts and merge the PR!

johnpoth commented 4 years ago

For sure! I'm still working on handling <unknown> last seen values in some events camel-k sends. I can merge the work afterwards. Thanks !

johnpoth commented 4 years ago

@astefanutti resolved merge conflicts, I also pushed hanlding <unknown> timestamps that should resolve the issue regarding the status bar you raised ? It needs some polishing but I think it's worth the effort especially if we are to reuse the timestamped columns for other resources. I'll try using the isValid function from moment.js that should clean things up a bit. Thanks !

astefanutti commented 4 years ago

@johnpoth Thanks a lot! Let's merge the PR and iterate. Once it's polished enough, I'll cut a release with all the good stuff that has been done since 0.7.0.