forked from TrueCloudLab/restic
check: cleanup s3 legacy detection
This commit is contained in:
parent
1dfd854769
commit
246559e654
1 changed files with 2 additions and 12 deletions
|
@ -14,7 +14,6 @@ import (
|
||||||
"github.com/minio/sha256-simd"
|
"github.com/minio/sha256-simd"
|
||||||
"github.com/restic/restic/internal/backend"
|
"github.com/restic/restic/internal/backend"
|
||||||
"github.com/restic/restic/internal/backend/s3"
|
"github.com/restic/restic/internal/backend/s3"
|
||||||
"github.com/restic/restic/internal/cache"
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
"github.com/restic/restic/internal/errors"
|
"github.com/restic/restic/internal/errors"
|
||||||
"github.com/restic/restic/internal/hashing"
|
"github.com/restic/restic/internal/hashing"
|
||||||
|
@ -241,17 +240,8 @@ func IsOrphanedPack(err error) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isS3Legacy(b backend.Backend) bool {
|
func isS3Legacy(b backend.Backend) bool {
|
||||||
// unwrap cache
|
be := backend.AsBackend[*s3.Backend](b)
|
||||||
if be, ok := b.(*cache.Backend); ok {
|
return be != nil && be.Layout.Name() == "s3legacy"
|
||||||
b = be.Backend
|
|
||||||
}
|
|
||||||
|
|
||||||
be, ok := b.(*s3.Backend)
|
|
||||||
if !ok {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return be.Layout.Name() == "s3legacy"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Packs checks that all packs referenced in the index are still available and
|
// Packs checks that all packs referenced in the index are still available and
|
||||||
|
|
Loading…
Reference in a new issue