corso/src/internal/kopia/filesystem.go
Keepers 5258ef0f36
assert correct error on s3 conn bad configs e2e (#4387)
#### Does this PR need a docs update or release note?

- [x]  No

#### Type of change

- [x] 🐛 Bugfix
- [x] 🤖 Supportability/Tests

#### Test Plan

- [x] 💚 E2E
2023-09-29 00:45:16 +00:00

35 lines
669 B
Go

package kopia
import (
"context"
"github.com/alcionai/clues"
"github.com/kopia/kopia/repo/blob"
"github.com/kopia/kopia/repo/blob/filesystem"
"github.com/alcionai/corso/src/pkg/control/repository"
"github.com/alcionai/corso/src/pkg/storage"
)
func filesystemStorage(
ctx context.Context,
repoOpts repository.Options,
s storage.Storage,
) (blob.Storage, error) {
fsCfg, err := s.ToFilesystemConfig()
if err != nil {
return nil, clues.Stack(err).WithClues(ctx)
}
opts := filesystem.Options{
Path: fsCfg.Path,
}
store, err := filesystem.New(ctx, &opts, true)
if err != nil {
return nil, clues.Stack(err).WithClues(ctx)
}
return store, nil
}