You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/31 01:14:23 UTC

[GitHub] [apisix] Hazel6869 commented on a diff in pull request #8180: feat: add dafault value roundrobin for upstream_schema

Hazel6869 commented on code in PR #8180:
URL: https://github.com/apache/apisix/pull/8180#discussion_r1008963585


##########
t/admin/upstream.t:
##########
@@ -727,3 +727,48 @@ GET /t
 {"error_msg":"failed to fetch ssl info by ssl id [1], wrong ssl type"}
 --- no_error_log
 [error]
+
+
+
+=== TEST 22: type with default vale
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local etcd = require("apisix.core.etcd")
+            local code, body = t('/apisix/admin/upstreams/admin_up',
+                ngx.HTTP_PUT,
+                [[{
+                    "nodes": {
+                        "127.0.0.1:8080": 1
+                    },
+                    "desc": "new upstream"
+                }]],
+                [[{
+                    "value": {
+                        "nodes": {
+                            "127.0.0.1:8080": 1
+                        },
+                        "type": "roundrobin",
+                        "desc": "new upstream"
+                    },
+                    "key": "/apisix/upstreams/admin_up"
+                }]]
+            )
+
+            ngx.status = code
+            ngx.say(body)
+
+            local res = assert(etcd.get('/upstreams/admin_up'))
+            local create_time = res.body.node.value.create_time

Review Comment:
   Right, I have fixed it.



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org