Skip to content

Commit

Permalink
use default configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aalu1418 committed Jul 8, 2024
1 parent c31e78b commit 82f4f2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func GetConfig(configurationName string, product Product) (TestConfig, error) {
var handleSpecialOverrides = func(logger zerolog.Logger, filename, configurationName string, target *TestConfig, content []byte, product Product) error {
switch product {
default:
err := ctf_config.BytesToAnyTomlStruct(logger, filename, configurationName, &testConfig, content)
err := ctf_config.BytesToAnyTomlStruct(logger, filename, configurationName, target, content)
if err != nil {
return fmt.Errorf("error reading file %s: %w", filename, err)
}
Expand All @@ -296,7 +296,7 @@ func GetConfig(configurationName string, product Product) (TestConfig, error) {
return TestConfig{}, fmt.Errorf("error reading embedded config: %w", err)
}

err = handleSpecialOverrides(logger, fileName, configurationName, &testConfig, file, product)
err = handleSpecialOverrides(logger, fileName, "", &testConfig, file, product) // use empty configurationName to read default config
if err != nil {
return TestConfig{}, fmt.Errorf("error unmarshalling embedded config: %w", err)
}
Expand All @@ -321,7 +321,7 @@ func GetConfig(configurationName string, product Product) (TestConfig, error) {
return TestConfig{}, fmt.Errorf("error reading file %s: %w", filePath, err)
}

err = handleSpecialOverrides(logger, fileName, configurationName, &testConfig, content, product)
err = handleSpecialOverrides(logger, fileName, "", &testConfig, content, product) // use empty configurationName to read default config
if err != nil {
return TestConfig{}, fmt.Errorf("error reading file %s: %w", filePath, err)
}
Expand All @@ -336,7 +336,7 @@ func GetConfig(configurationName string, product Product) (TestConfig, error) {
return TestConfig{}, err
}

err = handleSpecialOverrides(logger, Base64OverrideEnvVarName, configurationName, &testConfig, decoded, product)
err = handleSpecialOverrides(logger, Base64OverrideEnvVarName, "", &testConfig, decoded, product) // use empty configurationName to read default config
if err != nil {
return TestConfig{}, fmt.Errorf("error unmarshaling base64 config: %w", err)
}
Expand Down

0 comments on commit 82f4f2a

Please sign in to comment.