Skip to content

Commit

Permalink
Handle metal3 separately
Browse files Browse the repository at this point in the history
They don't exist in OCP 4.12 and below,
and they would fail gathering all other resources
  • Loading branch information
slintes committed Feb 22, 2024
1 parent 1207566 commit f1f4439
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions collection-scripts/gather
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ named_resources+=(${MEDIK8S_CRDS})
MEDIK8S_CRS=$(oc get crds -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep 'medik8s' | sed -z 's/\n/ /g')
group_resources+=(${MEDIK8S_CRS})

# Metal3
group_resources+=(metal3remediationtemplates)
group_resources+=(metal3remediations)

# Run the Collection of Resources using inspect
oc adm inspect --dest-dir must-gather --rotated-pod-logs --all-namespaces "${named_resources[@]}"
group_resources_text=$(IFS=, ; echo "${group_resources[*]}")
oc adm inspect --dest-dir must-gather --rotated-pod-logs --all-namespaces "${group_resources_text}"

# Handle metal3 separately as they don't exist in OCP 4.12 and below, and they would fail gathering all other resources
group_resources=(metal3remediationtemplates)
group_resources+=(metal3remediations)
group_resources_text=$(IFS=, ; echo "${group_resources[*]}")
oc adm inspect --dest-dir must-gather --rotated-pod-logs --all-namespaces "${group_resources_text}"

exit 0

0 comments on commit f1f4439

Please sign in to comment.