Skip to content

Commit

Permalink
AWS | DRA | Add timeout for readiness script
Browse files Browse the repository at this point in the history
[skip actions]
  • Loading branch information
eytannnaim committed May 22, 2024
1 parent 9ac8b07 commit 3d46717
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ The following table lists the _latest_ eDSF Kit releases, their release date and
</td>
<td>
1. Fixed a bug in Azure mx module when using private IP.
<br/>2. Small documentation Improvements.
<br/>2. Add DRA readiness timeout.
<br/>3. Small documentation Improvements.
</td>
</tr>
</table>
Expand Down
29 changes: 21 additions & 8 deletions modules/aws/dra-admin/readiness.tftpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
while true; do
response=$(curl -k -s -o /dev/null -w "%%{http_code}" --request GET 'https://${admin_server_public_ip}:8443/mvc/login')
if [ $response -eq 200 ]; then
exit 0
else
sleep 60
fi
done
#!/bin/bash

max_time=600 # Maximum time in seconds
start_time=$(date +%s)

while true; do
response=$(curl -k -s -o /dev/null -w "%%{http_code}" --request GET "https://${admin_server_public_ip}:8443/mvc/login")
if [ $response -eq 200 ]; then
exit 0
else
sleep 60
fi

current_time=$(date +%s)
elapsed_time=$(( current_time - start_time ))

if [ $elapsed_time -ge $max_time ]; then
echo "Timeout reached"
exit 1
fi
done
29 changes: 21 additions & 8 deletions modules/aws/dra-analytics/readiness.tftpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
while true; do
response=$(curl -k -s -o /dev/null -w "%%{http_code}" --request GET 'https://${admin_server_public_ip}:8443/mvc/login')
if [ $response -eq 200 ]; then
exit 0
else
sleep 60
fi
done
#!/bin/bash

max_time=600 # Maximum time in seconds
start_time=$(date +%s)

while true; do
response=$(curl -k -s -o /dev/null -w "%%{http_code}" --request GET "https://${admin_server_public_ip}:8443/mvc/login")
if [ $response -eq 200 ]; then
exit 0
else
sleep 60
fi

current_time=$(date +%s)
elapsed_time=$(( current_time - start_time ))

if [ $elapsed_time -ge $max_time ]; then
echo "Timeout reached"
exit 1
fi
done

0 comments on commit 3d46717

Please sign in to comment.