Skip to content

Multiple directory support #92

@tonyskapunk

Description

@tonyskapunk

It would be nice that omc supported using (reading from) multiple directories.

must-gather can use multiple images[1] to gather data about more than one feature by running a single command.

When multiple images are used, a directory is created for each image, for example:

❯ ls -t many/must_gather/
event-filter.html
timestamp
registry.lan-openshift4-ose-must-gather-sha256-e9601b492cbb375f0a05310efa6025691f8bba6a97667976cd4baf4adf0f244c/
registry.lan-container-native-virtualization-cnv-must-gather-rhel8-sha256-28d78a3ee2e818e2619b10b33b308984dbebe66e302c2f5a7dbd6f527d3b4806/

Currently when a single image is used, a single directory is created and omc can use the top level directory without problems:

❯ ls -t single/must_gather
event-filter.html
timestamp
registry.lan-openshift4-ose-must-gather-sha256-e9601b492cbb375f0a05310efa6025691f8bba6a97667976cd4baf4adf0f244c/

❯ omc use single/must_gather

❯ omc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.12.0-0.nightly-2023-05-18-160444   True        False         54m     Cluster version is 4.12.0-0.nightly-2023-05-18-160444

But when must-gather used multiple images, omc needs to specify the directory to use and switching between directories is very inconvenient, mostly when there are many directories

❯ omc use many/must_gather
Expected one directory in path: "/home/user/many/must_gather", found: 2.

## 😰 have to be specific

❯  omc use many/must_gather/registry.lan-container-native-virtualization-cnv-must-gather-rhel8-sha256-28d78a3ee2e818e2619b10b33b308984dbebe66e302c2f5a7dbd6f527d3b4806/

❯ omc get vmi -A
NAMESPACE   NAME     AGE   PHASE     IP   NODENAME
my-lb       lb-0     17m   Running        worker-0
my-lb       lb-1     20m   Running        worker-2

❯ omc get clusterversion
NAME   VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS

## 😰 have to switch

❯ omc use many/must_gather/registry.lan-openshift4-ose-must-gather-sha256-e9601b492cbb375f0a05310efa6025691f8bba6a97667976cd4baf4adf0f244c/

❯ omc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.55    True        False         2h3m    Cluster version is 4.7.55

It would be awesome if omc could use mutliple directories to look for the requested data.

[1] https://docs.openshift.com/container-platform/4.13/support/gathering-cluster-data.html#gathering-data-specific-features_gathering-cluster-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFERequest for enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions