-
Notifications
You must be signed in to change notification settings - Fork 2
fix: required changes for 3.1 compatibility #36
Changes from 12 commits
14256e9
2f294c1
4ac298b
b6e369b
788f46c
86df807
ff8aeb1
ab748dd
393daa9
739a308
001809f
884c12f
23c7b76
0345f15
ea9bcf7
b47d2e6
33e4b3c
9798f25
8bd2cdc
a7b66b9
74a909b
fc044a8
cddf098
821f5f7
4c25d00
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 |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| local tablex = require "pl.tablex" | ||
| local pretty = require "pl.pretty" | ||
| local utils = require "kong.tools.utils" | ||
| local nkeys = require "table.nkeys" | ||
|
|
||
| local cjson = { array_mt = {} } --- TODO(hbagdi) XXX analyze the impact | ||
| local is_reference = function(value) return false end | ||
|
|
@@ -55,6 +54,23 @@ do | |
| end | ||
| end | ||
|
|
||
| -- `table.nkeys()` is a LuaJIT function and is not available to the Lua VM that goks uses. | ||
| local nkeys | ||
| do | ||
| local ok | ||
| ok, nkeys = pcall(require, "table.nkeys") | ||
| if not ok then | ||
| nkeys = function (tab) | ||
| local count = 0 | ||
| for _, v in pairs(tab) do | ||
| if v ~= nil then | ||
| count = count + 1 | ||
| end | ||
| end | ||
| return count | ||
| end | ||
| end | ||
| end | ||
|
Contributor
Author
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. This is copypasta from resty/healthecheck.lua. I'm following the pattern of I can't tell if this resolves the issue, however. I get a new error: I'm able to validate the method is called. The if block beginning on line 62 is entered but The stacktrace is also not very illuminating: My guess is either:
Number 1 is the most reasonable, but I don't really understand what
Contributor
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.
the LOG_LEVELS = {
debug = ngx.DEBUG,
info = ngx.INFO,
notice = ngx.NOTICE,
warn = ngx.WARN,
error = ngx.ERR,
crit = ngx.CRIT,
alert = ngx.ALERT,
emerg = ngx.EMERG,
[ngx.DEBUG] = "debug",
[ngx.INFO] = "info",
[ngx.NOTICE] = "notice",
[ngx.WARN] = "warn",
[ngx.ERR] = "error",
[ngx.CRIT] = "crit",
[ngx.ALERT] = "alert",
[ngx.EMERG] = "emerg",
},lines 231-238 use the form Now to find where are those
Contributor
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.
Can't find them. I think the easiest would be to add to
Contributor
Author
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. |
||
|
|
||
| local validation_errors = { | ||
| -- general message | ||
|
|
||
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.
We're using the pattern "go.xxx" for those replacement modules:
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.
33e4b3c