forked from operator-framework/operator-lifecycle-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.99 KB
/
quickstart.yml
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
42
43
44
name: release-checks
on:
pull_request:
paths:
- 'deploy/upstream/quickstart/**'
workflow_dispatch:
jobs:
install-quickstart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl -sLo kind "$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '[.assets[] | select(.name == "kind-linux-amd64")] | first | .browser_download_url')"
chmod +x kind
sudo mv kind /bin/
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /bin/
kind create cluster
kind export kubeconfig
kubectl apply -f deploy/upstream/quickstart/crds.yaml
kubectl wait --timeout=5m --for=condition=Established crd $(kubectl get crd --output=jsonpath='{.items[*].metadata.name}')
kubectl apply -f deploy/upstream/quickstart/olm.yaml
# Note(tflannag): `kubectl wait` does not support waiting for resource creation: https://github.com/kubernetes/kubernetes/pull/87399.
wait_for_deployment() {
local deployment_name=$1
timeout=60
i=1
echo "Checking if the ${deployment_name} deployment is ready"
until kubectl -n olm get deployment ${deployment_name} -o jsonpath='{.status.conditions[?(@.status=="True")].type}' | grep "Available" 2>/dev/null; do
((i++))
if [[ ${i} -gt ${timeout} ]]; then
echo "the ${deployment_name} deployment has not become ready before the timeout period"
exit 1
fi
echo "waiting for ${deployment_name} deployment to report a ready status"
sleep 5
done
echo "The ${deployment_name} deployment is ready"
}
wait_for_deployment catalog-operator
wait_for_deployment olm-operator
wait_for_deployment packageserver