mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:38:25 +00:00
b2/s3: Move config validation from ApplyEnvironment to Open/Create
Conceptually the backend configuration should be validated when creating or opening the backend, but not when filling in information from environment variables into the configuration.
This commit is contained in:
@@ -550,9 +550,7 @@ func OpenRepository(ctx context.Context, opts GlobalOptions) (*repository.Reposi
|
||||
func parseConfig(loc location.Location, opts options.Options) (interface{}, error) {
|
||||
cfg := loc.Config
|
||||
if cfg, ok := cfg.(restic.ApplyEnvironmenter); ok {
|
||||
if err := cfg.ApplyEnvironment(""); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg.ApplyEnvironment("")
|
||||
}
|
||||
|
||||
// only apply options for a particular backend here
|
||||
|
||||
Reference in New Issue
Block a user