From 246559e654c24761483e5914dc37f7ebe008c3f7 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 19 Jan 2024 23:32:17 +0100 Subject: [PATCH] check: cleanup s3 legacy detection --- internal/checker/checker.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 5d324795d..df865cb41 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -14,7 +14,6 @@ import ( "github.com/minio/sha256-simd" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/s3" - "github.com/restic/restic/internal/cache" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/hashing" @@ -241,17 +240,8 @@ func IsOrphanedPack(err error) bool { } func isS3Legacy(b backend.Backend) bool { - // unwrap cache - if be, ok := b.(*cache.Backend); ok { - b = be.Backend - } - - be, ok := b.(*s3.Backend) - if !ok { - return false - } - - return be.Layout.Name() == "s3legacy" + be := backend.AsBackend[*s3.Backend](b) + return be != nil && be.Layout.Name() == "s3legacy" } // Packs checks that all packs referenced in the index are still available and