Skip to content

Commit

Permalink
Fix invalid istio health check (vernemq#307)
Browse files Browse the repository at this point in the history
Move `istio_health` function definition to before first call.
  • Loading branch information
kien-truong committed Dec 31, 2021
1 parent 5740129 commit 86d344d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/vernemq.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/usr/bin/env bash

# Check istio readiness
istio_health() {
cmd=$(curl -s http://localhost:15021/healthz/ready > /dev/null)
status=$?
return $status
}

NET_INTERFACE=$(route | grep '^default' | grep -o '[^ ]*$')
NET_INTERFACE=${DOCKER_NET_INTERFACE:-${NET_INTERFACE}}
IP_ADDRESS=$(ip -4 addr show ${NET_INTERFACE} | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sed -e "s/^[[:space:]]*//" | head -n 1)
Expand Down Expand Up @@ -152,13 +159,6 @@ fi

pid=0

# Check istio readiness
istio_health () {
cmd=$(curl -s http://localhost:15021/healtz/ready > /dev/null)
status=$?
return $status
}

# SIGUSR1-handler
siguser1_handler() {
echo "stopped"
Expand Down

0 comments on commit 86d344d

Please sign in to comment.