Skip to content

Commit

Permalink
Negate overlapping args with -o flag
Browse files Browse the repository at this point in the history
Fixes: red-hat-storage#137

Right now if someone runs must-gather in odf mode
by using `-o` or `--odf` flag and also issues one
of `-c`, `-cl`, `-ns` or `-cs`, these scripts will
be executed twice, adding to the collection time and
creating redundant collection.

Essentially, this patch prevents execution of any of the
sub-scripts that are already called by `-o` flag.

Signed-off-by: black-dragon74 <[email protected]>
  • Loading branch information
black-dragon74 authored and openshift-cherrypick-robot committed May 28, 2024
1 parent 36cb1bc commit 37694ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collection-scripts/gather
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,25 @@ if [ "$noobaa" == true ]; then
pids+=($!)
fi

if [ "$ceph" == true ]; then
if [ "$ceph" == true ] && [ "$odf" == false ]; then
echo "Collect ceph pod logs..."
gather_ceph_pod_logs &
pids+=($!)
fi

if [ "$cephlogs" == true ]; then
if [ "$cephlogs" == true ] && [ "$odf" == false ]; then
echo "Collect ceph daemon logs..."
gather_ceph_logs ${BASE_COLLECTION_PATH} &
pids+=($!)
fi

if [ "$namespaced" == true ]; then
if [ "$namespaced" == true ] && [ "$odf" == false ]; then
echo "Collect namespaced logs..."
gather_namespaced_resources ${BASE_COLLECTION_PATH} &
pids+=($!)
fi

if [ "$clusterscoped" == true ]; then
if [ "$clusterscoped" == true ] && [ "$odf" == false ]; then
echo "Collect clusterscoped logs..."
gather_clusterscoped_resources ${BASE_COLLECTION_PATH} &
pids+=($!)
Expand Down

0 comments on commit 37694ed

Please sign in to comment.