Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: ignore versionIDs from uploads unless using --s3-versions or --s3-versions-at

Nick Craig-Wood01877e5a0fc0
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index 8d4a4c5f0..c6977b8c9 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -5507,7 +5507,12 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
if err != nil {
return err
}
- o.versionID = versionID
+ // Only record versionID if we are using --s3-versions or --s3-version-at
+ if o.fs.opt.Versions || o.fs.opt.VersionAt.IsSet() {
+ o.versionID = versionID
+ } else {
+ o.versionID = nil
+ }
// User requested we don't HEAD the object after uploading it
// so make up the object as best we can assuming it got