-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add dafault value roundrobin for upstream_schema #8180
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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" | ||||
}]] | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to check the default value of Line 46 in 48b8431
|
||||
) | ||||
|
||||
ngx.status = code | ||||
ngx.say(body) | ||||
|
||||
local res = assert(etcd.get('/upstreams/admin_up')) | ||||
local create_time = res.body.node.value.create_time | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to check xxx_time, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I have fixed it. |
||||
assert(create_time ~= nil, "create_time is nil") | ||||
local update_time = res.body.node.value.update_time | ||||
assert(update_time ~= nil, "update_time is nil") | ||||
} | ||||
} | ||||
--- request | ||||
GET /t | ||||
--- response_body | ||||
passed | ||||
--- no_error_log | ||||
[error] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the doc too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. cc @Hazel6869
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done. pls see description. @spacewander @tokers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please put the doc in the same PR next time?
So people don't need to check another one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok