From 755634b12167421daa5c682fb2b056c3c8cd6125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 20 Aug 2026 12:53:49 +0200 Subject: [PATCH 1/2] feat: Gather namespaces Roles and RoleBindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Gondža --- gather_gitops.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/gather_gitops.sh b/gather_gitops.sh index 18e0069..6fadd37 100755 --- a/gather_gitops.sh +++ b/gather_gitops.sh @@ -71,6 +71,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 From c3abdf890b1c0ba98e90f5aa96aee62f368d3a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Mon, 24 Aug 2026 13:53:56 +0200 Subject: [PATCH 2/2] feat: Collect ClusterRole and ClusterRoleBinding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Gondža --- gather_gitops.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gather_gitops.sh b/gather_gitops.sh index 6fadd37..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)