Fix nightly test (#3739)
<!-- PR description--> --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [x] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
be500e9b92
commit
1ba103523a
@ -40,6 +40,7 @@ func m365Overrides(in map[string]string) map[string]string {
|
||||
func configureAccount(
|
||||
vpr *viper.Viper,
|
||||
readConfigFromViper bool,
|
||||
matchFromConfig bool,
|
||||
overrides map[string]string,
|
||||
) (account.Account, error) {
|
||||
var (
|
||||
@ -54,7 +55,9 @@ func configureAccount(
|
||||
if err != nil {
|
||||
return acct, clues.Wrap(err, "reading m365 configs from corso config file")
|
||||
}
|
||||
}
|
||||
|
||||
if matchFromConfig {
|
||||
if err := mustMatchConfig(vpr, m365Overrides(overrides)); err != nil {
|
||||
return acct, clues.Wrap(err, "verifying m365 configs in corso config file")
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ func getStorageAndAccountWithViper(
|
||||
config.RepoID = vpr.GetString(RepoID)
|
||||
}
|
||||
|
||||
config.Account, err = configureAccount(vpr, readConfigFromViper, overrides)
|
||||
config.Account, err = configureAccount(vpr, readConfigFromViper, mustMatchFromConfig, overrides)
|
||||
if err != nil {
|
||||
return config, clues.Wrap(err, "retrieving account configuration details")
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() {
|
||||
err = vpr.ReadInConfig()
|
||||
require.NoError(t, err, "reading repo config", clues.ToCore(err))
|
||||
|
||||
config, err := getStorageAndAccountWithViper(vpr, true, false, nil)
|
||||
config, err := getStorageAndAccountWithViper(vpr, true, true, nil)
|
||||
require.NoError(t, err, "getting storage and account from config", clues.ToCore(err))
|
||||
|
||||
readS3Cfg, err := config.Storage.S3Config()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user