-
Notifications
You must be signed in to change notification settings - Fork 34
Add OMC (Openshift Must Gather Client) compatibility layer #124
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
d74dd95 to
b258d4d
Compare
|
regression testing shows that the regular must-gather is properly collected [1]. |
collection-scripts/common.sh
Outdated
| source "${DIR_NAME}/bg.sh" | ||
|
|
||
| # OMC compatibility mode | ||
| export OMC=${OMC:-false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if this mode should be the default? support would otherwise always have to request it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, long term it would be ideal, especially because as you mentioned the request comes directly from the field. I wasn't sure about suddenly introduce a new default format that our team might not be aware of. Therefore, we could switch it to true and make it the default behavior and at the same time deprecate the old format, but it would be easier to coordinate such switch w/ the CI team (cifmw, forge-ci and so forth) to make sure we properly announce it and we don't get massive support requests to learn more the new format.
I would do the following things here:
- temporarily switch it to
truein a new PS so we can see it executed in CI - analyze any potential gap and see if we have all the usual information we need
- revert it to
falseand land this patch - have a follow up patch where:
a. we switch it totrue
b. we provide the required documentation to make life easier to the CI team
c. we deprecate the "old" way of collecting info
After this work is done, we can plan a downstream doc update to reflect the new behavior.
Let me know your thoughts, in the meantime I'll move to step 1 of this list so we can early identify any potential gap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming there's parity between the overall resources collected in OMC versus the old paradigm, I'd be quite happy to move to OMC as the default. I think we should give CI/QE a heads-up though in case they are somehow dependent on the current directory structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to default it to true and give a heads-up to the CI/QE team to the new structure: this seems a good direction and I'm ok to switch to this new format as well.
This commit introduces comprehensive OMC integration for openstack-must-gather, enabling seamless compatibility with the omc tool while maintaining full backward compatibility with existing workflows. Key architectural changes and decisions: - Centralized OMC compatibility layer in omc.sh and based on "oc adm inspect" - Clean separation between regular and OMC collection modes via OMC environment variable - Unified CRD discovery pattern across all scripts via global variable - Complete resource coverage including network, monitoring, and OLM resources The implementation uses a dual-mode approach where OMC=true triggers collection using oc adm inspect for standard Kubernetes directory structure, while regular mode continues using individual oc get commands for OpenStack-optimized organization. Enhanced features: - Network resource support (nncp, nnce, nns, net-attach-def, metallb) - Comprehensive CRD coverage via centralized regex pattern - Proper secret decoding and masking in both modes - Optimized command execution by moving from "grep|awk" to awk conversions Co-Authored-By: Claude <[email protected]> Signed-off-by: Francesco Pantano <[email protected]>
This PR adds comprehensive
OMCcompatibility toopenstack-must-gather, enabling users to analyzemust-gatherdata using the omc tool while maintaining full backward compatibility with existing workflows.Problem Statement
The current
openstack-must-gathercreates a custom directory structure optimized forOpenStacktroubleshooting, but this structure is incompatible with standardKubernetesanalysis tools likeOMCbased on this standard format.So far users had to choose between:
OpenStackworkflows)Solution Architecture
The solution proposed by this commit introduces an
omccompatibility layer that can be enabled while performing the gathering action.Collection Modes
The must-gather execution mode can be driven through the new
OMCenvironment variable.OMC=falseor unset): Maintains existing OpenStack-optimized structureOMC=true): Creates standard Kubernetes directory structure based onoc adm inspectKey Design Decisions
Centralized Compatibility Layer (
omc.sh):oc adm inspectfor standard structure generationNo Modification of Existing Scripts:
OMC=falseComprehensive Resource Coverage:
OpenStackresources (CRDs,custom resources,secrets)nncp,nnce,nns,net-attach-def,metallb)grafana,observability)subscriptions,CSVs,installplans)Unified CRD Discovery:
CRD_DOMAINSvariable incommon.shImplementation Highlights
grep | awkpatterns in favor of pureawkUsage example
oc adm must-gather \ --image=quay.io/openstack-k8s-operators/openstack-must-gather \ --dest-dir=/home/stack/must-gather-omc \ -- SOS= SOS_SERVICES= OMC=true OPENSTACK_DATABASES=ALL gather Analyzing with OMC # Navigate resources using omc omc get nodes omc -n openstack get glance omc -n openstack get pods omc get net-attach-def omc get nncp omc get ipaddresspools # Explore namespace structure omc describe namespace openstack Regular Collection remains unchanged oc adm must-gather \ --image=quay.io/openstack-k8s-operators/openstack-must-gather \ --dest-dir=$PWD/must-gather-regular