From f5bab284c302b87a99e0a6b065dfd9b6749eb3ba Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 27 Apr 2023 15:27:31 +0100 Subject: [PATCH] s3: fix missing "tier" metadata Before this change if the storage class wasn't set on the object, we didn't set the "tier" metadata. This made it impossible to filter on tier using the metadata filters. This returns the "tier" metadata as STANDARD if the storage class isn't set on the object. See: https://forum.rclone.org/t/copy-from-s3-to-another-s3-filter-by-storage-class/37861 --- backend/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index a71740c46..b1f284107 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -5865,7 +5865,7 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) setMetadata("content-disposition", o.contentDisposition) setMetadata("content-encoding", o.contentEncoding) setMetadata("content-language", o.contentLanguage) - setMetadata("tier", o.storageClass) + metadata["tier"] = o.GetTier() return metadata, nil }