-
Notifications
You must be signed in to change notification settings - Fork 1
/
.install-olm.sh
executable file
·41 lines (31 loc) · 1.16 KB
/
.install-olm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# This script is for installing OLM from a GitHub release
set -e
if [[ ${#@} -ne 1 ]]; then
echo "Usage: $0 version"
echo "* version: the github release version"
exit 1
fi
release=$1
url=https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${release}
namespace=olm
kubectl apply -f ${url}/crds.yaml
kubectl apply -f ${url}/olm.yaml
# wait for deployments to be ready
kubectl rollout status -w deployment/olm-operator --namespace="${namespace}"
kubectl rollout status -w deployment/catalog-operator --namespace="${namespace}"
retries=50
until [[ $retries == 0 || $new_csv_phase == "Succeeded" ]]; do
new_csv_phase=$(kubectl get csv -n "${namespace}" packageserver -o jsonpath='{.status.phase}' 2>/dev/null || echo "Waiting for CSV to appear")
if [[ $new_csv_phase != "$csv_phase" ]]; then
csv_phase=$new_csv_phase
echo "Package server phase: $csv_phase"
fi
sleep 1
retries=$((retries - 1))
done
if [ $retries == 0 ]; then
echo "CSV \"packageserver\" failed to reach phase succeeded"
exit 1
fi
kubectl rollout status -w deployment/packageserver --namespace="${namespace}"