Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
bug(chart) CRITICAL: Node startup probe loop infinite when ingress ho…
Browse files Browse the repository at this point in the history
…stname is set

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Feb 21, 2024
1 parent ff3b679 commit f231d40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion charts/selenium-grid/configs/node/nodePreStop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ function signal_node_to_drain() {

function replace_localhost_by_service_name() {
internal="${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}"
echo "SE_NODE_GRID_URL: ${SE_NODE_GRID_URL}"
if [[ "${SE_NODE_GRID_URL}" == *"/localhost"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//localhost/${internal}}
elif [[ "${SE_NODE_GRID_URL}" == *"/127.0.0.1"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//127.0.0.1/${internal}}
elif [[ "${SE_NODE_GRID_URL}" == *"/0.0.0.0"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//0.0.0.0/${internal}}
else
SE_GRID_URL=${SE_NODE_GRID_URL}
fi
echo "SE_GRID_URL: ${SE_GRID_URL}"
echo "Set SE_GRID_URL internally: ${SE_GRID_URL}"
}
replace_localhost_by_service_name

Expand Down
5 changes: 4 additions & 1 deletion charts/selenium-grid/configs/node/nodeProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ ID=$(echo $RANDOM)

function replace_localhost_by_service_name() {
internal="${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}"
echo "SE_NODE_GRID_URL: ${SE_NODE_GRID_URL}"
if [[ "${SE_NODE_GRID_URL}" == *"/localhost"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//localhost/${internal}}
elif [[ "${SE_NODE_GRID_URL}" == *"/127.0.0.1"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//127.0.0.1/${internal}}
elif [[ "${SE_NODE_GRID_URL}" == *"/0.0.0.0"* ]]; then
SE_GRID_URL=${SE_NODE_GRID_URL//0.0.0.0/${internal}}
else
SE_GRID_URL=${SE_NODE_GRID_URL}
fi
echo "SE_GRID_URL: ${SE_GRID_URL}"
echo "Set SE_GRID_URL internally: ${SE_GRID_URL}"
}
replace_localhost_by_service_name

Expand Down

0 comments on commit f231d40

Please sign in to comment.