File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -39,19 +39,27 @@ spec:
3939 sourceNamespace: openshift-marketplace
4040EOF
4141
42- # Wait for CSV to appear
42+ # Wait for CSV to appear and get its name
4343echo " Waiting for MCE operator CSV to be ready..."
44+ CSV_NAME=" "
4445for i in {1..60}; do
45- if oc get csv -n multicluster-engine -o name 2> /dev/null | grep -q multicluster-engine; then
46- echo " MCE CSV found, waiting for Succeeded phase..."
46+ CSV_NAME=$( oc get csv -n multicluster-engine -o name 2> /dev/null | grep multicluster-engine || true)
47+ if [ -n " $CSV_NAME " ]; then
48+ echo " MCE CSV found: $CSV_NAME "
4749 break
4850 fi
4951 echo " Waiting for MCE CSV to appear ($i /60)..."
5052 sleep 5
5153done
5254
55+ if [ -z " $CSV_NAME " ]; then
56+ echo " Error: MCE CSV not found after waiting"
57+ exit 1
58+ fi
59+
5360# Wait for CSV to be ready
54- oc wait --for=jsonpath=' {.status.phase}' =Succeeded csv -l operators.coreos.com/multicluster-engine.multicluster-engine -n multicluster-engine --timeout=300s
61+ echo " Waiting for CSV to reach Succeeded phase..."
62+ oc wait --for=jsonpath=' {.status.phase}' =Succeeded " $CSV_NAME " -n multicluster-engine --timeout=300s
5563
5664# Create MultiClusterEngine instance
5765echo " Creating MultiClusterEngine instance..."
Original file line number Diff line number Diff line change @@ -7,18 +7,26 @@ set -euo pipefail
77echo " Installing ACM Operator (release 2.14)..."
88oc apply -k https://github.com/redhat-cop/gitops-catalog/advanced-cluster-management/operator/overlays/release-2.14
99
10- # Wait for CSV to appear
10+ # Wait for CSV to appear and get its name
1111echo " Waiting for ACM operator CSV to be ready..."
12+ CSV_NAME=" "
1213for i in {1..60}; do
13- if oc get csv -n open-cluster-management -o name 2> /dev/null | grep -q advanced-cluster-management; then
14- echo " ACM CSV found, waiting for Succeeded phase..."
14+ CSV_NAME=$( oc get csv -n open-cluster-management -o name 2> /dev/null | grep advanced-cluster-management || true)
15+ if [ -n " $CSV_NAME " ]; then
16+ echo " ACM CSV found: $CSV_NAME "
1517 break
1618 fi
1719 echo " Waiting for ACM CSV to appear ($i /60)..."
1820 sleep 5
1921done
2022
23+ if [ -z " $CSV_NAME " ]; then
24+ echo " Error: ACM CSV not found after waiting"
25+ exit 1
26+ fi
27+
2128# Wait for CSV to be ready
22- oc wait --for=jsonpath=' {.status.phase}' =Succeeded csv -l operators.coreos.com/advanced-cluster-management.open-cluster-management -n open-cluster-management --timeout=300s
29+ echo " Waiting for CSV to reach Succeeded phase..."
30+ oc wait --for=jsonpath=' {.status.phase}' =Succeeded " $CSV_NAME " -n open-cluster-management --timeout=300s
2331
2432echo " ✓ ACM Operator installation complete"
You can’t perform that action at this time.
0 commit comments