Skip to content

Commit 44f2b82

Browse files
author
Michael Beaver
committed
AIAP Gate - Update script to use status-checker
This change updates the 20_apply_aiap.sh script to utilize the status-checker container to determine if airship-in-a-pod has successfully completed. It also includes a check to fail when the status-checker has detected a failure. Relates-To: #659 Change-Id: I3673de7157f498778154c798878ab20245396c62
1 parent 4f7a9db commit 44f2b82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: tools/airship-in-a-pod/scripts/20_apply_aiap.sh

+15
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ set -ex
2121

2222

2323
INTERVAL=15
24+
# Number of statuses that the status checker is looking at
25+
STATUS_CHECKER_NUM=3
26+
2427
READY=false
2528
KUBE_READY=false
2629

2730

31+
2832
# Wait for the Kubernetes environment to become completely ready
2933
while [[ $KUBE_READY == "false" ]];
3034
do
@@ -62,3 +66,14 @@ do
6266
sleep "$INTERVAL"
6367
done
6468

69+
# Now that all of the containers are ready, keep an eye on the status-checker
70+
# container until it shows that every status succeeds, and exit on any failure
71+
while [[ $(kubectl logs airship-in-a-pod -c status-checker --tail 1 | grep -o "SUCCESS" | wc -l) -lt ${STATUS_CHECKER_NUM} ]]
72+
do
73+
# If any status is listed as "FAILED" then we should kill the script with a non 0 exit code
74+
if [[ $(kubectl logs airship-in-a-pod -c status-checker --tail 1 | grep -c -o "FAILED") -gt 0 ]]; then
75+
kubectl logs airship-in-a-pod -c status-checker --tail 1
76+
exit 3
77+
fi
78+
sleep "$INTERVAL"
79+
done

0 commit comments

Comments
 (0)