Skip to content

Commit

Permalink
hack: check presence of the csv before running oc wait
Browse files Browse the repository at this point in the history
oc wait immediately exit if the resource is not present on the cluster.
Make sure resources are present before running oc wait.

Signed-off-by: Nitin Goyal <[email protected]>
  • Loading branch information
iamniting committed Nov 15, 2024
1 parent 396378c commit 99e7b8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hack/install-odf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ fi

"$OPERATOR_SDK" run bundle "$BUNDLE_IMG" --timeout=10m --security-context-config restricted -n "$INSTALL_NAMESPACE" --index-image "$CATALOG_DEPS_IMG"

# Check for the presence of the CSVs in the cluster for up to 5 minutes,
# Since 'oc wait' exits immediately if the resource is not found.
for i in {1..30}; do
if oc get -n "$INSTALL_NAMESPACE" csv $CSV_NAMES &> /dev/null; then
break
fi
sleep 10
done

oc wait --timeout=5m --for jsonpath='{.status.phase}'=Succeeded -n "$INSTALL_NAMESPACE" csv $CSV_NAMES || {

echo "CSV $CSV_NAMES did not succeed, describing CSV"
Expand Down

0 comments on commit 99e7b8b

Please sign in to comment.