diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-09-11 02:15:42 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-10 14:15:42 -0700 |
| commit | b64674018a618ea6a46137fd50fd687e8f72957f (patch) | |
| tree | 2caa27a25c72a8cb1cca7826369f9147b6b66d5f /weed/command/filer_remote_sync_dir.go | |
| parent | 3cb914f7e12ad0aba82f52399282c3ffd377013e (diff) | |
| download | seaweedfs-b64674018a618ea6a46137fd50fd687e8f72957f.tar.xz seaweedfs-b64674018a618ea6a46137fd50fd687e8f72957f.zip | |
[sync] override amz storage class, None to delete (#3639)
* override amz storage class, None to delete
https://github.com/seaweedfs/seaweedfs/issues/3636
* use empty string to delete
* without nil check
Diffstat (limited to 'weed/command/filer_remote_sync_dir.go')
| -rw-r--r-- | weed/command/filer_remote_sync_dir.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index 6f061bda8..288b89a5a 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -37,6 +37,12 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour var lastLogTsNs = time.Now().UnixNano() processEventFnWithOffset := pb.AddOffsetFunc(func(resp *filer_pb.SubscribeMetadataResponse) error { + storageClass := *option.storageClass + if storageClass == "" { + delete(resp.EventNotification.NewEntry.Extended, s3_constants.AmzStorageClass) + } else if storageClass != "None" { + resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass] = []byte(storageClass) + } processor.AddSyncJob(resp) return nil }, 3*time.Second, func(counter int64, lastTsNs int64) error { |
