Skip to content

Commit

Permalink
NO-ISSUE: Fix CI gather script for baremetal operator
Browse files Browse the repository at this point in the history
Agentclusterinstall and clusterdeployment queried only for
objects in the spoke namespace, which is not applicable in
the hypershift/capi space. This modifies it to look for all
those CRs in all the namespaces.
  • Loading branch information
CrystalChun authored and openshift-cherrypick-robot committed Feb 6, 2024
1 parent b5e80e1 commit 7e9320f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions deploy/operator/gather.sh
Expand Up @@ -43,15 +43,15 @@ function gather_operator_data() {
}

function gather_agentclusterinstall_data() {
readarray -t agentclusterinstall_objects < <(oc get agentclusterinstall -n ${SPOKE_NAMESPACE} -o json | jq -c '.items[]')
readarray -t agentclusterinstall_objects < <(oc get agentclusterinstall -A -o json | jq -c '.items[]')
for agentclusterinstall in "${agentclusterinstall_objects[@]}"; do
agentclusterinstall_name=$(echo ${agentclusterinstall} | jq -r .metadata.name)
agentclusterinstall_namespace=$(echo ${agentclusterinstall} | jq -r .metadata.namespace)

cluster_dir="${LOGS_DEST}/${agentclusterinstall_namespace}_${agentclusterinstall_name}"
cluster_dir="${LOGS_DEST}/agentclusterinstall"
mkdir -p "${cluster_dir}"

oc get agentclusterinstall -n ${agentclusterinstall_namespace} ${agentclusterinstall_name} -o yaml > "${cluster_dir}/agentclusterinstall.yaml"
oc get agentclusterinstall -n ${agentclusterinstall_namespace} ${agentclusterinstall_name} -o yaml > "${cluster_dir}/${agentclusterinstall_namespace}_${agentclusterinstall_name}.yaml"

events_url=$(echo ${agentclusterinstall} | jq -r .status.debugInfo.eventsURL)
if [ -n "${events_url}" ] && [ "${events_url}" != null ]; then
Expand Down Expand Up @@ -104,10 +104,11 @@ function gather_clusterdeployment_data() {
cd_dir="${LOGS_DEST}/clusterdeployment"
mkdir -p "${cd_dir}"

readarray -t cd_objects < <(oc get clusterdeployments.hive.openshift.io -n ${SPOKE_NAMESPACE} -o json | jq -c '.items[]')
readarray -t cd_objects < <(oc get clusterdeployments.hive.openshift.io -A -o json | jq -c '.items[]')
for cd in "${cd_objects[@]}"; do
cd_name=$(echo ${cd} | jq -r .metadata.name)
oc get clusterdeployments.hive.openshift.io -n "${SPOKE_NAMESPACE}" "${cd_name}" -o yaml > "${cd_dir}/${cd_name}.yaml"
cd_namespace=$(echo ${cd} | jq -r .metadata.namespace)
oc get clusterdeployments.hive.openshift.io -n "${cd_namespace}" "${cd_name}" -o yaml > "${cd_dir}/${cd_namespace}_${cd_name}.yaml"
done
}

Expand Down

0 comments on commit 7e9320f

Please sign in to comment.