You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings. Let's assume we have any golang package for glua-libs in somewhere outside of this repo. For example, ssh - https://github.com/spigell/luscheduler/tree/master/libs/ssh. There is no big deal to add glua-libs and custom resources to project, but if we will use plugin package with 3rd party modules inside then it seems to not loading.
local plugin = require("plugin")
local plugin_body = [[
local time = require("time")
local chef = require("chef")
local cron = require("ssh")
local i = 1
print(i)
time.sleep(2)
]]
local string_plugin = plugin.do_string(plugin_body)
string_plugin:run()
time.sleep(1)
if file_plugin:is_running() then
print("RUNNING")
else
print("NOT RUNNING")
print(string_plugin:error())
end
NOT RUNNING
<string>:3: module ssh not found:
no field package.preload['ssh']
stat ./ssh.lua: no such file or directory
stat /usr/local/share/lua/5.1/ssh.lua: no such file or directory
stat /usr/local/share/lua/5.1/ssh/init.lua: no such file or directory,
stack traceback:
[G]: in function 'require'
<string>:3: in main chunk
[G]: ?
Greetings. Let's assume we have any golang package for glua-libs in somewhere outside of this repo. For example,
ssh
- https://github.com/spigell/luscheduler/tree/master/libs/ssh. There is no big deal to add glua-libs and custom resources to project, but if we will useplugin
package with 3rd party modules inside then it seems to not loading.In plugin package creates a new Lua state with only static list of modules - https://github.com/vadv/gopher-lua-libs/blob/master/plugin/api.go#L75
Is there any change add modules to preload table in the state?
Loader
returned byrequire
contains only Lua table with methods without metadata and do not fit for PreloadModules function.The text was updated successfully, but these errors were encountered: