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(
|
func configureAccount(
|
||||||
vpr *viper.Viper,
|
vpr *viper.Viper,
|
||||||
readConfigFromViper bool,
|
readConfigFromViper bool,
|
||||||
|
matchFromConfig bool,
|
||||||
overrides map[string]string,
|
overrides map[string]string,
|
||||||
) (account.Account, error) {
|
) (account.Account, error) {
|
||||||
var (
|
var (
|
||||||
@ -49,7 +50,7 @@ func configureAccount(
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
if readConfigFromViper {
|
if matchFromConfig {
|
||||||
m365Cfg, err = m365ConfigsFromViper(vpr)
|
m365Cfg, err = m365ConfigsFromViper(vpr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return acct, clues.Wrap(err, "reading m365 configs from corso config file")
|
return acct, clues.Wrap(err, "reading m365 configs from corso config file")
|
||||||
|
|||||||
@ -284,7 +284,7 @@ func getStorageAndAccountWithViper(
|
|||||||
config.RepoID = vpr.GetString(RepoID)
|
config.RepoID = vpr.GetString(RepoID)
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Account, err = configureAccount(vpr, readConfigFromViper, overrides)
|
config.Account, err = configureAccount(vpr, readConfigFromViper, mustMatchFromConfig, overrides)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return config, clues.Wrap(err, "retrieving account configuration details")
|
return config, clues.Wrap(err, "retrieving account configuration details")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,10 +69,6 @@ func configureStorage(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if readConfigFromViper {
|
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 {
|
if b, ok := overrides[storage.Bucket]; ok {
|
||||||
overrides[storage.Bucket] = common.NormalizeBucket(b)
|
overrides[storage.Bucket] = common.NormalizeBucket(b)
|
||||||
}
|
}
|
||||||
@ -83,6 +79,10 @@ func configureStorage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if matchFromConfig {
|
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 {
|
if err := mustMatchConfig(vpr, s3Overrides(overrides)); err != nil {
|
||||||
return store, clues.Wrap(err, "verifying s3 configs in corso config file")
|
return store, clues.Wrap(err, "verifying s3 configs in corso config file")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user