don't match config in init repo
This commit is contained in:
parent
8683fbc067
commit
4d8ddec6ef
@ -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 (
|
||||
@ -49,7 +50,7 @@ func configureAccount(
|
||||
err error
|
||||
)
|
||||
|
||||
if readConfigFromViper {
|
||||
if matchFromConfig {
|
||||
m365Cfg, err = m365ConfigsFromViper(vpr)
|
||||
if err != nil {
|
||||
return acct, clues.Wrap(err, "reading m365 configs from 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")
|
||||
}
|
||||
|
||||
@ -69,10 +69,6 @@ func configureStorage(
|
||||
)
|
||||
|
||||
if readConfigFromViper {
|
||||
if s3Cfg, err = s3ConfigsFromViper(vpr); err != nil {
|
||||
return store, clues.Wrap(err, "reading s3 configs from corso config file")
|
||||
}
|
||||
|
||||
if b, ok := overrides[storage.Bucket]; ok {
|
||||
overrides[storage.Bucket] = common.NormalizeBucket(b)
|
||||
}
|
||||
@ -83,6 +79,10 @@ func configureStorage(
|
||||
}
|
||||
|
||||
if matchFromConfig {
|
||||
if s3Cfg, err = s3ConfigsFromViper(vpr); err != nil {
|
||||
return store, clues.Wrap(err, "reading s3 configs from corso config file")
|
||||
}
|
||||
|
||||
if err := mustMatchConfig(vpr, s3Overrides(overrides)); err != nil {
|
||||
return store, clues.Wrap(err, "verifying s3 configs in corso config file")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user