Skip to content

Commit

Permalink
Merge pull request #986 from dprince/operator_status_fix
Browse files Browse the repository at this point in the history
Check for running replicas for get-operator-status.sh
  • Loading branch information
openshift-merge-bot[bot] authored Dec 19, 2024
2 parents 11e411a + 565f374 commit 7b6c92f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions scripts/get-operator-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ if [ -z "$OPERATOR_NAME" ]; then
echo "Please set OPERATOR_NAME"; exit 1
fi

CSVNAME=$(oc get csv -n ${OPERATOR_NAMESPACE} -o jsonpath='{range .items[*]}{@.metadata.name}{"\n"}{end}' | grep -E "^${OPERATOR_NAME}-operator\.v")
if [ -z "$CSVNAME" ]; then
echo "NOTFOUND"
exit 1
fi

PHASE=$(oc get -n ${OPERATOR_NAMESPACE} csv/${CSVNAME} -o jsonpath='{.status.phase}')
echo $PHASE
if [ "$PHASE" != "Succeeded" ]; then
REPLICAS=$(oc get -n "${OPERATOR_NAMESPACE}" deployment ${OPERATOR_NAME}-operator-controller-manager -o json | jq -e '.status.availableReplicas')
if [ "$REPLICAS" != "1" ]; then
exit 1
fi
echo "Succeeded"
exit 0

0 comments on commit 7b6c92f

Please sign in to comment.