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


##########
apisix/discovery/dns/schema.lua:
##########
@@ -24,6 +24,18 @@ return {
                 type = "string",
             },
         },
+        order = {
+            type = "array",
+            minItems = 1,
+            maxItems = 5,
+            uniqueItems = true,
+            items = {
+                enum = {"last", "SRV", "A", "AAAA", "CNAME"},
+     --           ["not"] = {

Review Comment:
   Just for debug?



##########
t/discovery/dns/sanity.t:
##########
@@ -318,3 +318,24 @@ qr/upstream nodes: \{[^}]+\}/
 qr/upstream nodes: 
\{("127.0.0.1:1980":60,"127.0.0.2:1980":20|"127.0.0.2:1980":20,"127.0.0.1:1980":60)\}/
 --- response_body
 hello world
+
+
+
+=== TEST 16: prefer A than SRV when A is ahead of SRV in config.yaml
+--- apisix_yaml
+upstreams:
+    - service_name: "srv-a.test.local"
+      discovery_type: dns
+      type: roundrobin
+      id: 1
+discovery:
+    dns:
+        servers:
+            - "127.0.0.1:1053"
+        order:
+            - A

Review Comment:
   Is it possible to add some test about invalid input, like `a` or repeated 
record type?



-- 
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