Skip to content

Commit 2188f66

Browse files
committed
Skips health check during Puppet runs
Avoids false negatives in health checks when Puppet is running, which could indicate a deployment in progress.
1 parent d62fb9b commit 2188f66

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

templates/uitpas/api/deployment/service_healthcheck.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
HEALTH_URL="http://localhost:<%= @http_port_base %>/uitid/rest/uitpas/health"
44
CARDSYSTEM_HEALTH_URL="http://localhost:<%= @http_port_base %>/uitid/rest/cardsystem/login"
5+
# If Puppet is running, and possibily a deploy, we skip the health check to avoid false negatives
56
[ -f /opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock ] && return 0
67
/usr/bin/test $(/usr/bin/curl -s -o /dev/null $HEALTH_URL -w "%{http_code}") -eq 200 || return 1
78
/usr/bin/test $(/usr/bin/curl -s -o /dev/null $CARDSYSTEM_HEALTH_URL -w "%{http_code}") -eq 200

0 commit comments

Comments
 (0)