gmeghnag / omc

OpenShift Must-Gather Client
Apache License 2.0
154 stars 63 forks source link

omc events ? #183

Open schabrolles opened 3 weeks ago

schabrolles commented 3 weeks ago

Could it be possible to have: omc events

Like oc events, it brings options that oc get event doesn't have

Like event type filtering:

oc events --types=Warning
LAST SEEN                  TYPE      REASON                            OBJECT                                            MESSAGE
3m27s (x3279 over 2d20h)   Warning   FailedToRetrieveImagePullSecret   Pod/common-service-db-1                           Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.
2m26s (x3234 over 2d19h)   Warning   FailedToRetrieveImagePullSecret   Pod/elasticsea-0ac3-ib-6fb9-es-server-esnodes-2   Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.
2m10s (x3237 over 2d19h)   Warning   FailedToRetrieveImagePullSecret   Pod/elasticsea-0ac3-ib-6fb9-es-server-esnodes-0   Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.
99s (x3248 over 2d19h)     Warning   FailedToRetrieveImagePullSecret   Pod/elasticsea-0ac3-ib-6fb9-es-server-esnodes-1   Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.
90s (x3268 over 2d20h)     Warning   FailedToRetrieveImagePullSecret   Pod/common-service-db-2                           Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.

And object filtering:

oc events --types=Warning --for=Pod/common-service-db-2
LAST SEEN                  TYPE      REASON                            OBJECT                    MESSAGE
2m28s (x3268 over 2d20h)   Warning   FailedToRetrieveImagePullSecret   Pod/common-service-db-2   Unable to retrieve some image pull secrets (ibm-entitlement-key); attempting to pull the image may not succeed.

giving omc the same possibility could be nice. What do you think ?

oarribas commented 3 weeks ago

oc events adds several features, including output automatically sorted by "LAST SEEN". It was introduced in oc binary 4.13. More info about the events sub-command in [1].

[1] https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/1440-kubectl-events#limitations-of-the-existing-design