spacewander commented on code in PR #7079:
URL: https://github.com/apache/apisix/pull/7079#discussion_r878851211


##########
apisix/cli/ops.lua:
##########
@@ -611,6 +612,14 @@ Please modify "admin_key" in conf/config.yaml .
                 sys_conf["dns_resolver"][i] = "[" .. r .. "]"
             end
         end
+
+        -- check if the dns_resolver is ipv6 address with zone_id
+        -- Nnginx does not support this form
+        if r:find("%%") then
+            print("invalid dns resolver address: " .. r ..

Review Comment:
   Call it unsupported DNS resolver would be better?



##########
t/cli/test_dns.sh:
##########
@@ -96,3 +96,25 @@ if ! grep "resolver 127.0.0.1 valid=30 ipv6=off;" 
conf/nginx.conf > /dev/null; t
     echo "failed: ipv6 config doesn't take effect"
     exit 1
 fi
+
+# check dns resolver address
+echo '
+apisix:
+  dns_resolver:
+    - 127.0.0.1
+    - "fe80::21c:42ff:fe00:18%eth0"
+' > conf/config.yaml
+
+out=$(make init 2>&1 || true)
+
+if ! echo "$out" | grep "invalid dns resolver address"; then
+    echo "failed: should check dns resolver address is valid"
+    exit 1
+fi
+
+if ! grep "resolver 127.0.0.1 ipv6=on;" conf/nginx.conf > /dev/null; then

Review Comment:
   Should check `fe80::21c:42ff:fe00:18%eth0`'s absence too.



##########
apisix/cli/ops.lua:
##########
@@ -611,6 +612,14 @@ Please modify "admin_key" in conf/config.yaml .
                 sys_conf["dns_resolver"][i] = "[" .. r .. "]"
             end
         end
+
+        -- check if the dns_resolver is ipv6 address with zone_id
+        -- Nnginx does not support this form
+        if r:find("%%") then
+            print("invalid dns resolver address: " .. r ..

Review Comment:
   Please use `stderr:write` and watch out for the indent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to