Skip to content

Commit bba269b

Browse files
aabughoshrdavid
andauthored
need to sleep before the waiting command for the crd to be created (#224)
* need to sleep before the waiting command for the crd to be created * add busy wait fot the deployment to appear * add install crd for test * delete the deployment installation just to test * delete the deployment installation just to test * back the test pods * eq 4 on test * eq 2 on test * update the wait function on the crd * update the i in eait * update the i in wait * update the i in wait * Fix shellcheck warning * Fix shellcheck warning #2 * Fix indentation --------- Co-authored-by: David Rabkin <[email protected]>
1 parent c73a302 commit bba269b

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ install:
2020
./scripts/manage-service.sh deploy
2121
./scripts/deploy-network-policies.sh
2222
# ./scripts/install-prometheus-operator.sh
23-
# ./scripts/deploy-operator-crd-scaling.sh
23+
./scripts/deploy-operator-crd-scaling.sh
2424

2525
# creates a k8s cluster instance
2626
rebuild-cluster:
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22

3-
43
SCRIPT_DIR="$(dirname "$0")"
54

65
# shellcheck disable=SC1091 # Not following.
@@ -11,12 +10,24 @@ git clone $CRD_SCALING_URL
1110
## install the operator
1211
cd crd-operator-scaling || exit 1
1312
## install the crd
14-
1513
make manifests
1614
make install
1715
make deploy IMG=quay.io/testnetworkfunction/crd-operator-scaling:latest
1816
oc wait deployment new-pro-controller-manager -n "$TNF_EXAMPLE_CNF_NAMESPACE" --for=condition=available --timeout=240s
19-
2017
make addrole
2118
kubectl apply -f config/samples --validate=false
22-
oc wait deployment jack -n "$TNF_EXAMPLE_CNF_NAMESPACE" --for=condition=available --timeout=240s
19+
BIT=5
20+
NUM=15
21+
for i in $(seq $NUM); do
22+
printf 'Wait %d seconds for %d times...\n' $BIT "$i"
23+
sleep $BIT
24+
kubectl get deployment jack -n "$TNF_EXAMPLE_CNF_NAMESPACE" ||
25+
continue
26+
oc wait deployment jack \
27+
--for=condition=available \
28+
--namespace "$TNF_EXAMPLE_CNF_NAMESPACE" \
29+
--timeout=240s
30+
exit
31+
done
32+
printf >&2 'Exit by timeout after %d seconds.\n' $((BIT * NUM))
33+
exit 1

0 commit comments

Comments
 (0)