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.
This commit is contained in:
Anis Elleuch
2022-04-15 16:49:28 -07:00
committed by GitHub
parent 6a61b286b1
commit 1187be0ad2
+10
View File
@@ -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+"`.")