Skip to content

Commit 8418263

Browse files
authored
add csv name and version to must-gather (#10)
1 parent 2eb17c6 commit 8418263

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gather_gitops.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ function main() {
272272
echo " * Getting OpenShift Cluster Version..."
273273
run_and_log "oc version" "$GITOPS_DIR/oc-version.txt"
274274

275+
# requirement for custom must-gathers, see https://github.com/openshift/enhancements/blob/a5841f75dbc9afbab22e5baa8d2f1ff2f43e2df7/enhancements/oc/must-gather.md?plain=1#L88
276+
echo " * Getting OpenShift GitOps Version..."
277+
csv_name="$(oc -n openshift-gitops get csv -o name | grep 'openshift-gitops-operator')"
278+
oc -n openshift-gitops get "${csv_name}" -o jsonpath='{.spec.displayName}{"\n"}{.spec.version}' > "$GITOPS_DIR/version.txt"
279+
275280
echo " * Getting GitOps Operator Subscription..."
276281
run_and_log "oc get subs openshift-gitops-operator -n openshift-operators -o yaml" "$GITOPS_DIR/subscription.yaml"
277282
run_and_log "oc get subs openshift-gitops-operator -n openshift-operators -o json" "$GITOPS_DIR/subscription.json"

0 commit comments

Comments
 (0)