kxr / o-must-gather

oc like tool that works with must-gather rather than OpenShift API
GNU General Public License v3.0
161 stars 73 forks source link

omg will softlock/spend multiple minutes searching for a resource that does not exist on typo #80

Closed Scotchman0 closed 1 year ago

Scotchman0 commented 1 year ago

Hey there!

I was running into a repeated issue with what appears to be a logical search problem with the omg tool:

I observed that when I search for a common/easily found resource in a namespace: oc get deployment; omg is quite efficient at returning the results:

time omg get deployment
NAME            READY  UP-TO-DATE  AVAILABLE  AGE
router-default  2/2    2           2          66d
omg get deployment  0.06s user 0.01s system 98% cpu 0.069 total

However, when I misspell this resource (or call for something that doesn't exist; like eip on a gather from an sdn platform) omg will review every resource file available in the cluster and take an exceedingly long time to return the result; which is inevitably: [Error] Invalid object type: <string>

Example:

time omg get dpeloyment
^C^C^C[WARN] Skipped 8599/8778 lines from the end of alertmanagerconfigs.monitoring.coreos.com.yaml to the load the yaml file properly
[ERROR] Invalid object type: dpeloyment
omg get dpeloyment  218.27s user 2.31s system 99% cpu 3:41.19 total

Note that in the above test, we observe 218s go by before the system unlocks the process and returns the fail-result. (note also the multiple failed siginterupts being ignored by the process)

I am unable to sigint (ctrl+c) this process while it is running/stalled and I am forced to either abort the process entirely and recreate a new shell session and call the process again, or wait. (or forcibly terminate the process from another session).

This is a low-priority problem, but It is one that causes not-so-insignificant pain when I fat-finger a call and have to wait it out.

Appreciate your time!

Scotchman0 commented 1 year ago

I should also note: Thanks very much for making this tool available in the first place, it's been a boon to my success and I appreciate that you took the time to create it. Hopefully this issue's not a massively annoying one to review/find/debug; and I also respect that wontfix is a valid closure code. :)

Scotchman0 commented 1 year ago

self-closing due to length of time without update, have been using omc which is currently supported at --> https://github.com/gmeghnag/omc Thank you!