From 060276932d62fae12af6736b9512c85bdc90f48c Mon Sep 17 00:00:00 2001 From: Poorna Date: Thu, 5 Sep 2024 04:57:23 -0700 Subject: [PATCH] batch:repl fix copy from source -> remote (#20382) completes fix started by #20365 --- cmd/batch-handlers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/batch-handlers.go b/cmd/batch-handlers.go index 15e70a532..d129d09e6 100644 --- a/cmd/batch-handlers.go +++ b/cmd/batch-handlers.go @@ -1208,7 +1208,11 @@ func (r *BatchJobReplicateV1) Start(ctx context.Context, api ObjectLayer, job Ba s3Type := r.Target.Type == BatchJobReplicateResourceS3 || r.Source.Type == BatchJobReplicateResourceS3 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) if err := api.Walk(ctx, r.Source.Bucket, strings.TrimSpace(prefix), prefixWalkCh, WalkOptions{ Marker: lastObject,