batch:repl fix copy from source -> remote (#20382)

completes fix started by  #20365
This commit is contained in:
Poorna 2024-09-05 04:57:23 -07:00 committed by GitHub
parent 6224849fd1
commit 060276932d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1208,7 +1208,11 @@ func (r *BatchJobReplicateV1) Start(ctx context.Context, api ObjectLayer, job Ba
s3Type := r.Target.Type == BatchJobReplicateResourceS3 || r.Source.Type == BatchJobReplicateResourceS3 s3Type := r.Target.Type == BatchJobReplicateResourceS3 || r.Source.Type == BatchJobReplicateResourceS3
go func() { go func() {
for _, prefix := range r.Source.Prefix.F() { prefixes := r.Source.Prefix.F()
if len(prefixes) == 0 {
prefixes = []string{""}
}
for _, prefix := range prefixes {
prefixWalkCh := make(chan itemOrErr[ObjectInfo], 100) prefixWalkCh := make(chan itemOrErr[ObjectInfo], 100)
if err := api.Walk(ctx, r.Source.Bucket, strings.TrimSpace(prefix), prefixWalkCh, WalkOptions{ if err := api.Walk(ctx, r.Source.Bucket, strings.TrimSpace(prefix), prefixWalkCh, WalkOptions{
Marker: lastObject, Marker: lastObject,