Skip to content

Commit 33b5741

Browse files
author
OpenShift Bot
authored
Merge pull request #12509 from pecameron/bz1410721
Merged by openshift-bot
2 parents 5d6f8b4 + 82b3d97 commit 33b5741

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

images/ipfailover/keepalived/lib/config-generators.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ function generate_global_config() {
4444

4545
#
4646
# Generate VRRP checker script configuration section.
47+
# When a check script is provided use it instead of default script
48+
# The default script is suppressed When port is 0
4749
#
4850
# Example:
4951
# generate_script_config
@@ -56,13 +58,14 @@ function generate_script_config() {
5658
echo ""
5759
echo "vrrp_script ${CHECK_SCRIPT_NAME} {"
5860

59-
if [[ "${port}" == "0" ]]; then
60-
echo " script \"true\""
61+
if [[ -n "${HA_CHECK_SCRIPT}" ]]; then
62+
echo " script \"${HA_CHECK_SCRIPT}\""
6163
else
62-
if [[ -n "${HA_CHECK_SCRIPT}" ]]; then
63-
echo " script \"${HA_CHECK_SCRIPT}\""
64+
if [[ "${port}" == "0" ]]; then
65+
echo " script \"true\""
66+
else
67+
echo " script \"</dev/tcp/${serviceip}/${port}\""
6468
fi
65-
echo " script \"</dev/tcp/${serviceip}/${port}\""
6669
fi
6770

6871
echo " interval ${CHECK_INTERVAL_SECS}"
@@ -165,8 +168,6 @@ function generate_vip_section() {
165168

166169
#
167170
# Generate vrrpd instance configuration section.
168-
# This generates the vrrp_sync_group and vrrp_instance
169-
# There is one VIP per vrrp_sync_group
170171
#
171172
# Examples:
172173
# generate_vrrpd_instance_config arp 1 "10.1.2.3" enp0s8 "252" "master"

0 commit comments

Comments
 (0)