@@ -201,18 +201,18 @@ func (h *helm) luaValues(svc *console.ServiceDeploymentForAgent) (map[string]int
201201 return newValues , valuesFiles , nil
202202 }
203203
204- p := luautils .NewProcessor (h .dir )
205- defer p . L .Close ()
204+ L := luautils .NewLuaState (h .dir )
205+ defer L .Close ()
206206
207207 // Register global values and valuesFiles in Lua
208- valuesTable := p . L .NewTable ()
209- p . L .SetGlobal ("values" , valuesTable )
208+ valuesTable := L .NewTable ()
209+ L .SetGlobal ("values" , valuesTable )
210210
211- valuesFilesTable := p . L .NewTable ()
212- p . L .SetGlobal ("valuesFiles" , valuesFilesTable )
211+ valuesFilesTable := L .NewTable ()
212+ L .SetGlobal ("valuesFiles" , valuesFilesTable )
213213
214214 for name , binding := range bindings (svc ) {
215- p . L .SetGlobal (name , luautils .GoValueToLuaValue (p . L , binding ))
215+ L .SetGlobal (name , luautils .GoValueToLuaValue (L , binding ))
216216 }
217217
218218 var luaString string
@@ -230,16 +230,16 @@ func (h *helm) luaValues(svc *console.ServiceDeploymentForAgent) (map[string]int
230230 }
231231
232232 // Execute the Lua script
233- err := p . L .DoString (luaString )
233+ err := L .DoString (luaString )
234234 if err != nil {
235235 return nil , valuesFiles , err
236236 }
237237
238- if err := luautils .MapLua (p . L .GetGlobal ("values" ).(* lua.LTable ), & newValues ); err != nil {
238+ if err := luautils .MapLua (L .GetGlobal ("values" ).(* lua.LTable ), & newValues ); err != nil {
239239 return nil , valuesFiles , err
240240 }
241241
242- if err := luautils .MapLua (p . L .GetGlobal ("valuesFiles" ).(* lua.LTable ), & valuesFiles ); err != nil {
242+ if err := luautils .MapLua (L .GetGlobal ("valuesFiles" ).(* lua.LTable ), & valuesFiles ); err != nil {
243243 return nil , valuesFiles , err
244244 }
245245
0 commit comments