-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from jlojosnegros/nro_error_messages
must-gather: numaresources: Avoid error messages when NRO is not installed
- Loading branch information
Showing
2 changed files
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# get crds | ||
for crd_name in numaresourcesschedulers.nodetopology.openshift.io numaresourcesoperators.nodetopology.openshift.io noderesourcetopologies.topology.node.k8s.io | ||
do | ||
# get crd definition | ||
oc adm inspect --dest-dir must-gather crd/${crd_name} | ||
|
||
# get crd instances | ||
oc adm inspect --dest-dir must-gather ${crd_name} | ||
done | ||
|
||
# Get NRO namespace and gather all the data there | ||
. namespace | ||
NRO_NAMESPACE=$(nro_namespace) | ||
|
||
oc adm inspect --dest-dir must-gather ns/${NRO_NAMESPACE} | ||
if [ -z "$NRO_NAMESPACE" ] | ||
then | ||
echo "Numaresources Operator namespace not detected. Skipping NRO data gathering" | ||
else | ||
# get crds | ||
for crd_name in numaresourcesschedulers.nodetopology.openshift.io numaresourcesoperators.nodetopology.openshift.io noderesourcetopologies.topology.node.k8s.io | ||
do | ||
# get crd definition | ||
oc adm inspect --dest-dir must-gather crd/${crd_name} | ||
|
||
# get crd instances | ||
oc adm inspect --dest-dir must-gather ${crd_name} | ||
done | ||
|
||
oc adm inspect --dest-dir must-gather ns/${NRO_NAMESPACE} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters