Skip to content

Commit

Permalink
Delete warnings messages on 3party libraries
Browse files Browse the repository at this point in the history
With this commit, the _G write guard error message, that was not good
at all to have.

Fix THREESCALE-5816

Signed-off-by: Eloy Coto <[email protected]>
  • Loading branch information
eloycoto committed Jun 22, 2021
1 parent c4769a4 commit d8bfb0c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed Payload limit content-length response header [PR #1266](https://github.com/3scale/APIcast/pull/1266) [THREESCALE-6736](https://issues.redhat.com/browse/THREESCALE-6736)
- Fixed IPcheck policy issues with invalid IP [PR #1273](https://github.com/3scale/APIcast/pull/1273) [THREESCALE-7075](https://issues.redhat.com/browse/THREESCALE-7075)
- Disabled content-caching globally if no policy at all [PR #1278](https://github.com/3scale/APIcast/pull/1278) [THREESCALE-7016](https://issues.redhat.com/browse/THREESCALE-7016)

- Fixed warning messages [PR #1282](https://github.com/3scale/APIcast/pull/1282) [THREESCALE-5816](https://issues.redhat.com/browse/THREESCALE-5816)

### Added

Expand Down
2 changes: 1 addition & 1 deletion gateway/Roverfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fifo 0.2-0||development
http 0.3-0||development
inspect 3.1.1-0||production
ldoc 1.4.6-2||development
liquid 0.1.6-1||production
liquid 0.1.7-1||production
jsonschema 0.8-0|aa4740624cca4c10585bd7d086b42aa0b9ab14fa|testing
lpeg 1.0.2-1||development
lpeg_patterns 0.5-0||development
Expand Down
6 changes: 6 additions & 0 deletions gateway/src/apicast/cli/filesystem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
-- This module exposes functions that work with filesystem.
-- So far exposes only function - to recursively traverse a filesystem path.
-- Workaround for https://github.com/stevedonovan/Penlight/issues/265
--

--- These lines to avoid _G write guard issues, external depencies
-- See https://github.com/openresty/lua-nginx-module/issues/1558 for more info
rawset(_G, 'lfs', false)
rawset(_G, 'warn', false)

local pl_path = require('pl.path')
local exists, isdir = pl_path.exists, pl_path.isdir
Expand Down
27 changes: 19 additions & 8 deletions gateway/src/resty/yaml.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
local yaml = require('lyaml.functional')
local init = false
local _M = {}

yaml.NULL = ngx.null
yaml.isnull = function(value) return value == ngx.null end
local function init_yaml()
if not init then
init = true
yaml = require('lyaml.functional')
yaml.NULL = ngx.null
yaml.isnull = function(value) return value == ngx.null end
YAML = require('lyaml')
_M["load"] = YAML.load
_M["null"] = YAML.null
end
end

local YAML = require('lyaml')

local _M = {
load = YAML.load,
null = YAML.null,
local mt = {
__index = function (self, key)
init_yaml()
return _M[key]
end
}

return _M
return setmetatable({}, mt)

0 comments on commit d8bfb0c

Please sign in to comment.