remove redundant os preload
Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
parent
31031548b7
commit
f2a260641b
|
@ -65,8 +65,6 @@ func (vm *VM) NewLuaState() (*lua.LState, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// preload our 'safe' version of the OS library. Allows the 'local os = require("os")' to work
|
||||
l.PreloadModule(lua.OsLibName, lualifted.SafeOsLoader)
|
||||
// preload kube library. Allows the 'local kube = require("kube")' to work
|
||||
l.PreloadModule(KubeLibName, KubeLoader)
|
||||
return l, err
|
||||
|
@ -326,8 +324,6 @@ func NewWithContext(ctx context.Context) (*lua.LState, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// preload our 'safe' version of the OS library. Allows the 'local os = require("os")' to work
|
||||
l.PreloadModule(lua.OsLibName, lualifted.SafeOsLoader)
|
||||
// preload kube library. Allows the 'local kube = require("kube")' to work
|
||||
l.PreloadModule(KubeLibName, KubeLoader)
|
||||
if ctx != nil {
|
||||
|
|
|
@ -34,7 +34,7 @@ import (
|
|||
|
||||
// OpenSafeOs open safe os
|
||||
func OpenSafeOs(L *lua.LState) int {
|
||||
tabmod := L.RegisterModule(lua.TabLibName, osFuncs)
|
||||
tabmod := L.RegisterModule(lua.OsLibName, osFuncs)
|
||||
L.Push(tabmod)
|
||||
return 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue