@@ -200,7 +200,7 @@ func (h *helm) luaValues(svc *console.ServiceDeploymentForAgent) (map[string]int
200200 return nil , valuesFiles , fmt .Errorf ("no service found" )
201201 }
202202
203- if svc .Helm == nil || (svc .Helm .LuaScript == nil && svc .Helm .LuaFile == nil ) {
203+ if svc .Helm == nil || (svc .Helm .LuaScript == nil && svc .Helm .LuaFile == nil && svc . Helm . LuaFolder == nil ) {
204204 return newValues , valuesFiles , nil
205205 }
206206
@@ -228,16 +228,18 @@ func (h *helm) luaValues(svc *console.ServiceDeploymentForAgent) (map[string]int
228228 return nil , valuesFiles , fmt .Errorf ("failed to read lua file %s: %w" , * svc .Helm .LuaFile , err )
229229 }
230230 luaString = string (luaContents )
231- default :
232- return nil , valuesFiles , fmt .Errorf ("no lua script or file provided" )
233231 }
234232
235233 if svc .Helm .LuaFolder != nil && len (* svc .Helm .LuaFolder ) > 0 {
236234 luaFolder , err := h .luaFolder (svc , * svc .Helm .LuaFolder )
237235 if err != nil {
238236 return nil , valuesFiles , err
239237 }
240- luaString = luaFolder + "\n \n " + luaString
238+ luaString = luaFolder + luaString
239+ }
240+
241+ if luaString == "" {
242+ return nil , valuesFiles , fmt .Errorf ("no lua script, file, or folder provided" )
241243 }
242244
243245 // Execute the Lua script
@@ -323,7 +325,7 @@ func (h *helm) luaFolder(svc *console.ServiceDeploymentForAgent, folder string)
323325
324326 luaFileContents := make ([]string , 0 )
325327 for _ , file := range luaFiles {
326- luaContents , err := os .ReadFile (file )
328+ luaContents , err := os .ReadFile (filepath . Join ( h . dir , file ) )
327329 if err != nil {
328330 return "" , fmt .Errorf ("failed to read lua file %s: %w" , file , err )
329331 }
0 commit comments