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

Commit

Permalink
bug(chart): SE_NODE_GRID_URL missing port when hostname is `seleniu…
Browse files Browse the repository at this point in the history
…m-grid.local`

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Feb 21, 2024
1 parent 2aa675e commit 65a97e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions charts/selenium-grid/configs/node/nodeProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,27 @@ replace_localhost_by_service_name
if curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o /tmp/nodeProbe${ID}; then
NODE_ID=$(jq -r '.value.node.nodeId' /tmp/nodeProbe${ID})
NODE_STATUS=$(jq -r '.value.node.availability' /tmp/nodeProbe${ID})
if [ -n "${NODE_ID}" ]; then
echo "Node responds the ID: ${NODE_ID} with status: ${NODE_STATUS}"
else
echo "Wait for the Node to report its status"
exit 1
fi

curl -sfk "${SE_GRID_URL}/status" -o /tmp/gridProbe${ID}
GRID_NODE_ID=$(jq -e ".value.nodes[].id|select(. == \"${NODE_ID}\")" /tmp/gridProbe${ID} | tr -d '"' || true)
if [ -n "${GRID_NODE_ID}" ]; then
echo "Grid responds a matched Node ID: ${GRID_NODE_ID}"
fi

if [ "${NODE_STATUS}" = "UP" ] && [ -n "${NODE_ID}" ] && [ -n "${GRID_NODE_ID}" ] && [ "${NODE_ID}" = "${GRID_NODE_ID}" ]; then
echo "Node ID: ${NODE_ID} with status: ${NODE_STATUS}"
echo "Found in the Grid a matched Node ID: ${GRID_NODE_ID}"
echo "Node ID: ${NODE_ID} is found in the Grid. The registration is successful."
exit 0
else
echo "Node ID: ${NODE_ID} is not found in the Grid. The registration could be in progress."
exit 1
fi
else
echo "Wait for the Node to report its status"
exit 1
fi
2 changes: 2 additions & 0 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ Get the url of the grid. If the external url can be figured out from the ingress
{{- if .Values.ingress.enabled -}}
{{- if or (ne (.Values.ingress.ports.http | toString) "80") (ne (.Values.ingress.ports.https | toString) "443") -}}
{{- $port = printf ":%s" (ternary (.Values.ingress.ports.http | toString) (.Values.ingress.ports.https | toString) (eq (include "seleniumGrid.url.schema" .) "http")) -}}
{{- else if and .Values.ingress.hostname (eq (tpl .Values.ingress.hostname $) "selenium-grid.local") }}
{{- $port = $port -}}
{{- else -}}
{{- $port = "" -}}
{{- end -}}
Expand Down
2 changes: 0 additions & 2 deletions tests/charts/ci/base-auth-ingress-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ hub:
value: "15"
- name: SE_REJECT_UNSUPPORTED_CAPS
value: "false"
- name: SE_OPTS
value: "--max-threads 12"

components:
subPath: *gridAppRoot
Expand Down

0 comments on commit 65a97e4

Please sign in to comment.