diff --git a/integration-tests.yaml b/integration-tests.yaml index db489a41fec8b8360daee6ee3f0521fa2355b0c6..d4c12587fbe430ee03ebf36c0f962f20504797a2 100644 --- a/integration-tests.yaml +++ b/integration-tests.yaml @@ -31,6 +31,8 @@ spec: - "example.com" # whether to update the external view - "false" + # whether to publish IPv6 records + - "true" env: - name: DRY_RUN value: "true" diff --git a/publish_dns.sh b/publish_dns.sh index 20fbf89aa6bfaa7e864342b7ffb4665d0d6ec24b..a3fbad906a5cc3e85b915a72f4faf26d02ec0d03 100755 --- a/publish_dns.sh +++ b/publish_dns.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ "$#" -ne 4 ]]; then +if [[ "$#" -ne 5 ]]; then echo "Not all arguments have been provided" 1>&2 exit 1 fi @@ -9,6 +9,7 @@ INGRESS_CONTROLLER=$1 DNS_MANAGER=$2 ZONE=$3 REGISTER_IN_EXTERNAL_VIEW=$4 +PUBLISH_IPV6=$5 NSUPDATE_FILE="/tmp/ingress.nsupdate" TTL=60 @@ -61,9 +62,12 @@ while sleep 1; do continue fi - # first do a reverse lookup of the IPv4 addresses, then do an AAAA lookup for the IPv6 addresses - REVERSE_DNS_HOSTNAMES=$(for i in ${IPV4_ADDRESSES}; do dig @"${DNS_MANAGER}" +short -x "$i"; done) - IPV6_ADDRESSES=$(for i in ${REVERSE_DNS_HOSTNAMES}; do dig @"${DNS_MANAGER}" +short "$i" AAAA; done) + # Sometimes we might want to disable publishing AAAA records for IPv6 addresses of our nodes due to connectivity issues + if [ "$PUBLISH_IPV6" = "true" ]; then + # first do a reverse lookup of the IPv4 addresses, then do an AAAA lookup for the IPv6 addresses + REVERSE_DNS_HOSTNAMES=$(for i in ${IPV4_ADDRESSES}; do dig @"${DNS_MANAGER}" +short -x "$i"; done) + IPV6_ADDRESSES=$(for i in ${REVERSE_DNS_HOSTNAMES}; do dig @"${DNS_MANAGER}" +short "$i" AAAA; done) + fi cat <<EOF > ${NSUPDATE_FILE} server ${DNS_MANAGER}