Skip to content

Commit bd50206

Browse files
committed
fix(chart): node probe ignore proxy in sending request
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent ab3f8b8 commit bd50206

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

charts/selenium-grid/configs/node/nodePreStop.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function get_grid_url() {
4949
SE_SUB_PATH=""
5050
fi
5151
grid_url=${SE_SERVER_PROTOCOL}://${SE_BASIC_AUTH}${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}${SE_SUB_PATH}
52-
grid_url_checks=$(curl -m ${max_time} -s -o /dev/null -w "%{http_code}" ${grid_url})
52+
grid_url_checks=$(curl --noproxy "*" -m ${max_time} -s -o /dev/null -w "%{http_code}" ${grid_url})
5353
if [ "${grid_url_checks}" = "401" ]; then
5454
echo "$(date +%FT%T%Z) [${probe_name}] - Host requires Basic Auth. Please add the credentials to the SE_BASIC_AUTH variable (e.g: user:password). preStop ignores to send drain request to upstream."
5555
grid_url=""
@@ -62,7 +62,7 @@ function get_grid_url() {
6262
function signal_distributor_to_drain_node() {
6363
if [ "${DISTRIBUTED_MODE}" = true ]; then
6464
echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Distributor to drain node"
65-
curl -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://${SE_DISTRIBUTOR_HOST}:${SE_DISTRIBUTOR_PORT}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}"
65+
curl --noproxy "*" -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://${SE_DISTRIBUTOR_HOST}:${SE_DISTRIBUTOR_PORT}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}"
6666
fi
6767
}
6868

@@ -71,17 +71,17 @@ function signal_hub_to_drain_node() {
7171
get_grid_url
7272
if [ -n "${grid_url}" ]; then
7373
echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Hub to drain node"
74-
curl -m ${max_time} -k -X POST ${grid_url}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}"
74+
curl --noproxy "*" -m ${max_time} -k -X POST ${grid_url}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}"
7575
fi
7676
fi
7777
}
7878

7979
function signal_node_to_drain() {
8080
echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Node to drain itself"
81-
curl -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}"
81+
curl --noproxy "*" -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}"
8282
}
8383

84-
if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status > ${tmp_node_file}; then
84+
if curl --noproxy "*" -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status > ${tmp_node_file}; then
8585
NODE_ID=$(jq -r '.value.node.nodeId' ${tmp_node_file} || "")
8686
if [ -n "${NODE_ID}" ]; then
8787
echo "$(date +%FT%T%Z) [${probe_name}] - Current Node ID is: ${NODE_ID}"
@@ -93,7 +93,7 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st
9393
# Wait for the current session to be finished if any
9494
while true; do
9595
# Attempt the cURL request and capture the exit status
96-
endpoint_http_code=$(curl --retry ${retry_time} -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file} -w "%{http_code}")
96+
endpoint_http_code=$(curl --noproxy "*" --retry ${retry_time} -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file} -w "%{http_code}")
9797
endpoint_status=$?
9898
echo "$(date +%FT%T%Z) [${probe_name}] - Fetch the Node status via cURL with exit status: ${endpoint_status}, HTTP code: ${endpoint_http_code}"
9999

charts/selenium-grid/configs/node/nodeProbe.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function get_grid_url() {
3535
SE_SUB_PATH=""
3636
fi
3737
grid_url=${SE_SERVER_PROTOCOL}://${SE_BASIC_AUTH}${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}${SE_SUB_PATH}
38-
grid_url_checks=$(curl -m ${max_time} -skf -o /dev/null -w "%{http_code}" ${grid_url})
38+
grid_url_checks=$(curl --noproxy "*" -m ${max_time} -skf -o /dev/null -w "%{http_code}" ${grid_url})
3939
if [ "${grid_url_checks}" = "401" ]; then
4040
echo "$(date +%FT%T%Z) [${probe_name}] - Host requires Basic Auth. Please add the credentials to the SE_BASIC_AUTH variable (e.g: user:password)."
4141
help_message
@@ -48,7 +48,7 @@ function get_grid_url() {
4848
fi
4949
}
5050

51-
if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file}; then
51+
if curl --noproxy "*" -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file}; then
5252
NODE_ID=$(jq -r '.value.node.nodeId' ${tmp_node_file} || "")
5353
NODE_STATUS=$(jq -r '.value.node.availability' ${tmp_node_file} || "")
5454
if [ -n "${NODE_ID}" ]; then
@@ -60,7 +60,7 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st
6060

6161
get_grid_url
6262

63-
curl -m ${max_time} -sfk "${grid_url}/status" -o ${tmp_grid_file}
63+
curl --noproxy "*" -m ${max_time} -sfk "${grid_url}/status" -o ${tmp_grid_file}
6464
GRID_NODE_ID=$(jq -e ".value.nodes[].id|select(. == \"${NODE_ID}\")" ${tmp_grid_file} | tr -d '"' || "")
6565
if [ -n "${GRID_NODE_ID}" ]; then
6666
echo "$(date +%FT%T%Z) [${probe_name}] - Grid responds a matched Node ID: ${GRID_NODE_ID}"

0 commit comments

Comments
 (0)