fix(libstack): resolve env vars correctly in Compose BE-11420 (#166)

pull/12408/head
andres-portainer 2024-11-26 18:09:12 -03:00 committed by GitHub
parent 13143bc7ea
commit 145ffeea40
1 changed files with 11 additions and 12 deletions

View File

@ -103,7 +103,6 @@ func withComposeService(
return fmt.Errorf("failed to load the compose file: %w", err)
}
if options.EnvFilePath != "" {
// Work around compose path handling
for i, service := range project.Services {
for j, envFile := range service.EnvFiles {
@ -113,12 +112,12 @@ func withComposeService(
}
}
// Set the services environment variables
if p, err := project.WithServicesEnvironmentResolved(true); err == nil {
project = p
} else {
return fmt.Errorf("failed to resolve services environment: %w", err)
}
}
return composeFn(composeService, project)
})