Skip to content

Commit

Permalink
fix: hack to use FTL_CONFIG during ftltest (#1341)
Browse files Browse the repository at this point in the history
Work around for #1309 until we get proper test support.
  • Loading branch information
alecthomas authored Apr 26, 2024
1 parent 513f4e8 commit cf5223c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/configuration/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"

"github.com/alecthomas/types/optional"
Expand Down Expand Up @@ -41,7 +42,11 @@ func NewDefaultSecretsManagerFromEnvironment(ctx context.Context) (*Manager[Secr
// NewDefaultConfigurationManagerFromEnvironment creates a new configuration
// manager from the default ftl-project.toml.
func NewDefaultConfigurationManagerFromEnvironment(ctx context.Context) (*Manager[Configuration], error) {
cr := ProjectConfigResolver[Configuration]{}
var configs []string
if envar, ok := os.LookupEnv("FTL_CONFIG"); ok {
configs = strings.Split(envar, ",")
}
cr := ProjectConfigResolver[Configuration]{Config: configs}
return (DefaultConfigMixin{}).NewConfigurationManager(ctx, cr)
}

Expand Down

0 comments on commit cf5223c

Please sign in to comment.