remove redundant os preload

Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
changzhen 2024-01-10 16:08:41 +08:00
parent 31031548b7
commit f2a260641b
2 changed files with 1 additions and 5 deletions

View File

@ -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 {

View File

@ -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
}