From 9a5d891220d26db11959f393338a0e11d33b8fe7 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:54:46 +0200 Subject: [PATCH] Revert "Read config from env var first then override with TOML" This reverts commit 2b2fb180dbf936bf8549fb7d40e2084b83e5820b. --- integration-tests/testconfig/testconfig.go | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index 2ec0a4c66c6..fb692c56a75 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -312,18 +312,6 @@ func GetConfig(configurationNames []string, product Product) (TestConfig, error) testConfig := TestConfig{} testConfig.ConfigurationNames = configurationNames - logger.Info().Msg("Setting env vars from testsecrets dot-env files") - err := ctf_config.LoadSecretEnvsFromFiles() - if err != nil { - return TestConfig{}, errors.Wrapf(err, "error reading test config values from ~/.testsecrets file") - } - - logger.Info().Msg("Reading config values from existing env vars") - err = testConfig.ReadFromEnvVar() - if err != nil { - return TestConfig{}, errors.Wrapf(err, "error reading test config values from env vars") - } - logger.Debug().Msgf("Will apply configurations named '%s' if they are found in any of the configs", strings.Join(configurationNames, ",")) // read embedded configs is build tag "embed" is set @@ -377,6 +365,18 @@ func GetConfig(configurationNames []string, product Product) (TestConfig, error) } } + logger.Info().Msg("Setting env vars from testsecrets dot-env files") + err := ctf_config.LoadSecretEnvsFromFiles() + if err != nil { + return TestConfig{}, errors.Wrapf(err, "error reading test config values from ~/.testsecrets file") + } + + logger.Info().Msg("Reading config values from existing env vars") + err = testConfig.ReadFromEnvVar() + if err != nil { + return TestConfig{}, errors.Wrapf(err, "error reading test config values from env vars") + } + logger.Info().Msgf("Overriding config from %s env var", Base64OverrideEnvVarName) configEncoded, isSet := os.LookupEnv(Base64OverrideEnvVarName) if isSet && configEncoded != "" {