Skip to content

Commit 46a79e6

Browse files
committed
fix(docker): Improve the fallback mechanism implementation.
1 parent 2b92582 commit 46a79e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dockerfiles/agent-discovery/find-name.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ done
8181

8282
# Check if jenkins_controller is reachable, otherwise fall back to multi_jenkins_controller
8383
JENKINS_CONTROLLER="jenkins_controller"
84-
if ! curl -s -f http://jenkins_controller:8080/login > /dev/null; then
85-
JENKINS_CONTROLLER="multi_jenkins_controller"
86-
fi
84+
if ! curl -s -f "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
85+
echo "Primary controller not reachable, falling back to multi controller..."
86+
JENKINS_CONTROLLER="multi_jenkins_controller"
87+
fi
8788

8889
# Check If Jenkins is running or not
8990
# If the message is found, awk exits with a non-zero status (1), and the loop continues.

0 commit comments

Comments
 (0)