Only match with viper config if it was read (#3860)
Fix a regression introduced in 1ba103523ae. The `matchFromConfig` block should only be entered if we read config from viper. --- #### Does this PR need a docs update or release note? - [x] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #3856 #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
2c6417d2eb
commit
fa79cd5a72
@ -7,12 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased] (beta)
|
||||
|
||||
### Fixed
|
||||
- Allow repo connect to succeed when a `corso.toml` file was not provided but configuration is specified using environment variables and flags.
|
||||
|
||||
## [v0.11.0] (beta) - 2023-07-18
|
||||
|
||||
### Added
|
||||
- Drive items backup and restore link shares
|
||||
- Restore commands now accept an optional top-level restore destination with the `--destination` flag. Setting the destination to '/' will restore items back into their original location.
|
||||
- Restore commands can specify item collision behavior. Options are Skip (default), Replace, and Copy.
|
||||
- Introduced repository maintenance commands to help optimize the repository as well as unreferenced data.
|
||||
|
||||
### Fixed
|
||||
- Return a ServiceNotEnabled error when a tenant has no active SharePoint license.
|
||||
|
||||
@ -50,7 +50,6 @@ func configureAccount(
|
||||
if err != nil {
|
||||
return acct, clues.Wrap(err, "reading m365 configs from corso config file")
|
||||
}
|
||||
}
|
||||
|
||||
if matchFromConfig {
|
||||
providerType := vpr.GetString(AccountProviderTypeKey)
|
||||
@ -62,6 +61,7 @@ func configureAccount(
|
||||
return acct, clues.Wrap(err, "verifying m365 configs in corso config file")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// compose the m365 config and credentials
|
||||
m365 = GetM365(m365Cfg)
|
||||
|
||||
@ -450,7 +450,7 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount_noFileOnlyOverride
|
||||
StorageProviderTypeKey: storage.ProviderS3.String(),
|
||||
}
|
||||
|
||||
cfg, err := getStorageAndAccountWithViper(vpr, false, false, overrides)
|
||||
cfg, err := getStorageAndAccountWithViper(vpr, false, true, overrides)
|
||||
require.NoError(t, err, "getting storage and account from config", clues.ToCore(err))
|
||||
|
||||
readS3Cfg, err := cfg.Storage.S3Config()
|
||||
|
||||
@ -75,7 +75,6 @@ func configureStorage(
|
||||
if p, ok := overrides[storage.Prefix]; ok {
|
||||
overrides[storage.Prefix] = common.NormalizePrefix(p)
|
||||
}
|
||||
}
|
||||
|
||||
if matchFromConfig {
|
||||
providerType := vpr.GetString(StorageProviderTypeKey)
|
||||
@ -87,6 +86,7 @@ func configureStorage(
|
||||
return store, clues.Wrap(err, "verifying s3 configs in corso config file")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if s3Cfg, err = s3CredsFromViper(vpr, s3Cfg); err != nil {
|
||||
return store, clues.Wrap(err, "reading s3 configs from corso config file")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user