From 36ed0482eca91d1fa3efa4a5c7a7445516c6bd58 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Thu, 2 Apr 2020 14:39:47 +0100 Subject: 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 --- .../sdc-catalog-fe/templates/default/ready-probe.sh.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default') diff --git a/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/ready-probe.sh.erb b/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/ready-probe.sh.erb index bad5f878dd..5b772ecb15 100644 --- a/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/ready-probe.sh.erb +++ b/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/ready-probe.sh.erb @@ -1,8 +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 %>/sdc1/rest/healthCheck) +health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc1/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 -- cgit 1.2.3-korg