Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show info regarding the files used when running omg commands #15

Open
oarribas opened this issue Oct 28, 2020 · 5 comments
Open

Show info regarding the files used when running omg commands #15

oarribas opened this issue Oct 28, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@oarribas
Copy link

oarribas commented Oct 28, 2020

When running omg logs command, the file with the log is shown before the logs. For example:

$ omg logs -n openshift-apiserver apiserver-xxxxxxxxx-yyyyy -c openshift-apiserver

must-gather.local.xxxxxxxxxxxxxxxxx.tar.gz/must-gather.local.xxxxxxxxxxxxxxxxx/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/namespaces/openshift-apiserver/pods/apiserver-xxxxxxxxx-yyyyy/openshift-apiserver/openshift-apiserver/logs/current.log

[...the log here...]

It would be helpful to see also the used files for other commands, specially if the command not show information, like No resources found for type "resource" found in namespace "_all"

If there are several files involved, maybe a new parameter to only see the files instead would be better. Example:

$ omg get pods -A --only-show-files

[...list of all the yamls used...]

With this information, it would be easy to check if something is missing.

Also, thanks for the tool, it is really useful!!

@kxr kxr self-assigned this Oct 28, 2020
@kxr kxr added the enhancement New feature or request label Oct 28, 2020
@kxr
Copy link
Owner

kxr commented Oct 28, 2020

@oarribas I think it is a good idea, and should be easy to implement. I will get it done. Thanks.

@oarribas
Copy link
Author

Thanks @kxr , awesome!

@vlours
Copy link

vlours commented Nov 10, 2020

Hi @kxr

In addition to @oarribas request, would it be possible to display the current used path when running the omg use without any parameters?

In some cases, I'm working with multiple must-gather folders based on different environments (DEV, QA, PROD), and I got confused to remember which one I'm using at some point.
That will be useful to just confirm the used path.

I know that you can find the current path from the file ~/.omgconfig, but I think this should be also available from the command.

Thanks

@kxr
Copy link
Owner

kxr commented Nov 20, 2020

@vlours Done :)

  • When run without any arguments i.e, just omg use, omg will show you the details of the currently selected must-gather. For example:

      # omg use ./must-gather.local.2723199189299891619
      Now using project "openshift-monitoring" on must-gather "/home/knaeem/Downloads/must-gather.local.2723199189299891619/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-d7c882054a4528eda72e69a7988c5931b5a1643913b11bfd2575a78a8620808f"
    
      # omg use
      Current must-gather: /home/knaeem/Downloads/must-gather.local.2723199189299891619/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-d7c882054a4528eda72e69a7988c5931b5a1643913b11bfd2575a78a8620808f
          Current Project: openshift-monitoring
          Cluster API URL: ['https://api.ocp4.aidemo.local:6443']
         Cluster Platform: ['oVirt']
    
  • To facilitate users working with multiple must-gathers, you can now set the current working directory to be used as the must-gather path. In this case, simply switching the current working directory to the desired must-gather will be enough to start using that must-gather. To use this mode, simply run omg use --cwd. For example:

      # omg use --cwd
      Using your current working directory
    
      # cd /home/knaeem/Downloads/must-gather.local.2723199189299891619/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-d7c882054a4528eda72e69a7988c5931b5a1643913b11bfd2575a78a8620808f
    
      # omg use
      Current must-gather: .
          Current Project: openshift-monitoring
          Cluster API URL: ['https://api.ocp4.aidemo.local:6443']
         Cluster Platform: ['oVirt']
    
      # cd /home/knaeem/Downloads/must-gather.local.7890185621691109993/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-549bd48582a9fa615b8728bc6e1d66f3a9c829f415d9ddd58f95eb978be50274
    
      # omg use
      Current must-gather: .
          Current Project: openshift-monitoring
          Cluster API URL: ['https://api.ocpprod.example.com:6443']
         Cluster Platform: ['None']
    

@vlours
Copy link

vlours commented Nov 23, 2020

Awesome! That looks really good.
Waiting for the version 1.0.2 to be released 😉

Thank you Khizer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants