Skip to content

Commit a7c4d13

Browse files
committed
Reduce install.sh flakiness.
Occasionally install.sh flakes out when a CRD takes too long to become Established, or when the packageserver CSV takes longer than 30s to reach the Succeeded phase. This commit adds a kubectl wait after applying the CRDs and bumps the packageserver CSV timeout to 5 minutes, which should make the script more reliable.
1 parent ce46c64 commit a7c4d13

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scripts/install.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,25 @@ release=$1
1515
url=https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${release}
1616
namespace=olm
1717

18-
kubectl apply -f ${url}/crds.yaml
19-
kubectl apply -f ${url}/olm.yaml
18+
kubectl apply -f "${url}/crds.yaml"
19+
kubectl wait --for=condition=Established -f "${url}/crds.yaml"
20+
kubectl apply -f "${url}/olm.yaml"
2021

2122
# wait for deployments to be ready
2223
kubectl rollout status -w deployment/olm-operator --namespace="${namespace}"
2324
kubectl rollout status -w deployment/catalog-operator --namespace="${namespace}"
2425

25-
retries=50
26-
until [[ $retries == 0 || $new_csv_phase == "Succeeded" ]]; do
26+
retries=30
27+
until [[ $retries == 0 ]]; do
2728
new_csv_phase=$(kubectl get csv -n "${namespace}" packageserver -o jsonpath='{.status.phase}' 2>/dev/null || echo "Waiting for CSV to appear")
2829
if [[ $new_csv_phase != "$csv_phase" ]]; then
2930
csv_phase=$new_csv_phase
3031
echo "Package server phase: $csv_phase"
3132
fi
32-
sleep 1
33+
if [[ "$new_csv_phase" == "Succeeded" ]]; then
34+
break
35+
fi
36+
sleep 10
3337
retries=$((retries - 1))
3438
done
3539

0 commit comments

Comments
 (0)