Skip to content

Commit

Permalink
Use a different variable to collect CRS
Browse files Browse the repository at this point in the history
Instead of using the same "resources" variable that is used a lot in the
collection-scripts, this change customize the variable name used to collect
CR(s), and it avoid collision with other get_resources happenening in
other namespaces.

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Nov 26, 2023
1 parent c29c9fb commit 3904c48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collection-scripts/gather_crs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ if [[ -z "$DIR_NAME" ]]; then
fi

# Resource list
resources=()
res=()

# explictly adding rabbit in the grep because it's not part of the openstack
# umbrella and we rely on the upstream rabbitmq-cluster-operator
for i in $(/usr/bin/oc get crd | grep -E "(openstack|rabbitmq)\.(org|com)" | awk '{print $1}')
do
resources+=("$i")
res+=("$i")
done

# explicitly adding Metal3 BareMetalHosts
resources+=("baremetalhosts.metal3.io")
res+=("baremetalhosts.metal3.io")

# we use nested loops to nicely output objects partitioned per namespace, kind
echo "Gathering CRs"
for resource in "${resources[@]}"; do
for resource in "${res[@]}"; do
/usr/bin/oc get "${resource}" --all-namespaces -o custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace --no-headers 2> /dev/null | \
while read -r ocresource; do
ocobject=$(echo "$ocresource" | awk '{print $1}')
Expand Down

0 comments on commit 3904c48

Please sign in to comment.