Skip to content

Commit 86184da

Browse files
committed
wait for CSV by name instead of label selector
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 0e4b827 commit 86184da

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

hack/acm/install-mce.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,27 @@ spec:
3939
sourceNamespace: openshift-marketplace
4040
EOF
4141

42-
# Wait for CSV to appear
42+
# Wait for CSV to appear and get its name
4343
echo "Waiting for MCE operator CSV to be ready..."
44+
CSV_NAME=""
4445
for 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
5153
done
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
5765
echo "Creating MultiClusterEngine instance..."

hack/acm/install-operator.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@ set -euo pipefail
77
echo "Installing ACM Operator (release 2.14)..."
88
oc 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
1111
echo "Waiting for ACM operator CSV to be ready..."
12+
CSV_NAME=""
1213
for 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
1921
done
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

2432
echo "✓ ACM Operator installation complete"

0 commit comments

Comments
 (0)