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
This commit is contained in:
Nick Craig-Wood 2023-04-27 15:27:31 +01:00
parent c75dfa6436
commit f5bab284c3

View file

@ -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
}