diff options
author | andre.schmid <andre.schmid@est.tech> | 2020-04-02 14:39:47 +0100 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-04-06 06:29:26 +0000 |
commit | 36ed0482eca91d1fa3efa4a5c7a7445516c6bd58 (patch) | |
tree | b4bd4c5f39f013a13c85649061591ee1a4d8a517 /catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates | |
parent | 94e7778319778713c0b4e2ccf590cefc6e18c21e (diff) |
Fix ready probe exit code
The exit code ranges from 0 to 255, so it should not be
returning the http status code.
This was breaking the health check for the docker_run.sh
script, which was always getting a 0 return code in a
case of 503 http status for example.
Change-Id: I52b2923cdfc0d7389894917ccc4aa58468ac8bdc
Issue-ID: SDC-2867
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates')
-rw-r--r-- | catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb index 35aef8ea17..9f6646d63d 100644 --- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb +++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb @@ -1,11 +1,9 @@ #!/bin/bash -health_Check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc2/rest/healthCheck) +health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc2/rest/healthCheck) -if [[ "$health_Check_http_code" -eq 200 ]]; then - exit 0 +if [[ "$health_check_http_code" -eq 200 ]]; then + exit 0 else - exit $health_Check_http_code + echo "Health check http status: $health_check_http_code" + exit 1 fi - - - |