mirror of
https://github.com/restic/restic.git
synced 2026-10-16 06:37:12 +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:
1 parent
19ac12d95b
commit
3a3cf608f5
12 files changed
+23
-45
No files matched your search
@@ -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