diff --git a/gather_gitops.sh b/gather_gitops.sh index 18e0069..7990cc2 100755 --- a/gather_gitops.sh +++ b/gather_gitops.sh @@ -62,6 +62,8 @@ while read -r API_GROUP APIRESOURCE API_PLURAL_NAME; do oc get "${APIRESOURCE}" -o=yaml >"${LOGS_DIR}/cluster-scoped-resources/${API_GROUP}/${API_PLURAL_NAME}.yaml" done +oc adm inspect --dest-dir=${LOGS_DIR} clusterrole,clusterrolebinding > /dev/null + # Inspecting namespace reported in ARGOCD_CLUSTER_CONFIG_NAMESPACES, openshift-gitops and openshift-gitops-operator, and namespaces containing ArgoCD instances echo "gather_gitops:$LINENO] inspecting \$ARGOCD_CLUSTER_CONFIG_NAMESPACES, openshift-gitops and openshift-gitops-operator namespaces and namespaces containing ArgoCD instances .." | tee -a ${LOGS_DIR}/gather_gitops.log readarray -t SUBSCRIPTIONS < <(oc get subs -A --ignore-not-found -o json | jq '.items[] | select(.metadata.name=="openshift-gitops-operator") | .spec.config.env[]?|select(.name=="ARGOCD_CLUSTER_CONFIG_NAMESPACES")| " " + .value | sub(","; " ")' -rj) @@ -71,6 +73,7 @@ oc get ns --ignore-not-found "${SUBSCRIPTIONS[@]}" "${ARGO_CRDS[@]}" openshift-g while read -r NAMESPACE; do echo "gather_gitops:$LINENO] inspecting namespace $NAMESPACE .." | tee -a ${LOGS_DIR}/gather_gitops.log oc adm inspect --dest-dir=${LOGS_DIR} "ns/$NAMESPACE" > /dev/null + oc adm inspect --dest-dir=${LOGS_DIR} -n "$NAMESPACE" roles,rolebindings > /dev/null echo "gather_gitops:$LINENO] inspecting csv,sub,ip for namespace $NAMESPACE .." | tee -a ${LOGS_DIR}/gather_gitops.log readarray -t CSVS_SUBS_IPS < <(oc get --ignore-not-found clusterserviceversions.operators.coreos.com,installplans.operators.coreos.com,subscriptions.operators.coreos.com -o name -n "$NAMESPACE") if [ "${#CSVS_SUBS_IPS[@]}" -eq 0 ]; then