From 1187be0ad2d878eb9e2970690ce2c22bfc7411c5 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sat, 16 Apr 2022 00:49:28 +0100 Subject: [PATCH] mirror: Do not create remote bucket with --dry-run (#4054) In a site wide mirroring, non existing buckets in the destination site are still created if --dry-run is passed. This commit will avoid this. This commit also prints a mirror message of the newly created buckets in a site wide mirroring. --- cmd/mirror-main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index 9887e73f..60e5ec0b 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -946,6 +946,16 @@ func runMirror(ctx context.Context, cancelMirror context.CancelFunc, srcURL, dst withLock = true } } + + mj.status.PrintMsg(mirrorMessage{ + Source: newSrcURL, + Target: newTgtURL, + }) + + if mj.opts.isFake { + continue + } + // Bucket only exists in the source, create the same bucket in the destination if err := newDstClt.MakeBucket(ctx, cli.String("region"), false, withLock); err != nil { errorIf(err, "Unable to create bucket at `"+newTgtURL+"`.")