Skip to content

Commit

Permalink
Create check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bayram-ozkan authored Jan 7, 2025
1 parent 1b3d78e commit 609ce6c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cat check.sh
#!/usr/bin/bash
# DO NOT MODIFY THIS FILE ("Check My Solution" will fail)

res=$(kubectl get pods -l app=nginx --no-headers -o json | jq -r '.items[] | "\(.status.containerStatuses[0].state.waiting.reason // .status.phase)"')
res=$(echo $res|tr -d '\r')

if [[ "$res" != "Running" ]]
then
echo -n "NO"
exit 1
fi

res=$(curl -s 10.43.216.196:80|grep -c Welcome)
if [[ "$res" -eq 2 ]]
then
echo -n "OK"
else
echo "NO"
fi

0 comments on commit 609ce6c

Please sign in to comment.