gmeghnag / omc

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

[RFE] Additional info to `omc use` command #173

Open oarribas opened 3 months ago

oarribas commented 3 months ago

When selecting a new directory for using with the omc use command, the following information is shown:

$ omc use must-gather.local.tar.gz/must-gather.local.xxxxx/
Must-Gather  : /home/user/must-gather.local.tar.gz/must-gather.local.xxxxx/
/xxxxxxx
Project      : default
ApiServerURL : https://api.openshift.example.com:6443
Platform     : xxxx

Some additional information in the above output will be useful, like:

Also, if exist the must-gather.logs file inside the must-gather directory (it was included in 4.16 oc binary by [1]), show a line in red if the minor version of the oc binary and the version of the cluster is not the same. For example: If the must-gather.logs file has differences in the z-stream, do nothing:

ClientVersion: 4.16.0
ClusterVersion: Stable at "4.16.2"

but if the file contains differences in the minor version, show a message (if possible in orange color) stating that the version of the oc binary and the version of the cluster differs:

ClientVersion: 4.16.1
ClusterVersion: Stable at "4.15.1"

So, output will be something similar to

Must-Gather  : /home/user/must-gather.local.tar.gz/must-gather.local.xxxxx/
/xxxxxxx
Project      : default                       ##### if there is only one project/namespace, show here: "There is only one Project"
ApiServerURL : https://api.openshift.example.com:6443
Platform     : xxxx
ClusterVersion : 4.Y.Z
Image: cluster-logging-rhel9-operator               #### only if there is a sub-directory with image name and not only `inspect` directory

Note: The must-gather was generated with `oc` version 4.16.z while the cluster is 4.11.7            #### In orange, only if the minor version differs
Note: There is an inspect and an image directory. It usually means that the must-gather image failed and inspect was used as a fallback.      #### only if there is an inspect and an image directory at the same time in the same must-gather directory.

[1] https://issues.redhat.com/browse/WRKLDS-1012

oarribas commented 1 month ago

@gmeghnag , I can see the clusterID added to the omc use output by commit 373b57c6934b8d64828668374e0f9efd625b0698. Can this be checked to add additional information?