From 282246fff24962da00545b8401eeaab15a011821 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 12 Dec 2016 14:31:46 -0800 Subject: [PATCH] mirror: --remove should properly remove files on target. (#1926) This bug happened after rm-main was refactored. Fixes https://github.com/minio/minio/issues/3432 --- cmd/mirror-main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index 952c3106..79854ef3 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -185,15 +185,15 @@ func (ms *mirrorSession) doRemove(sURLs URLs) URLs { return sURLs.WithError(nil) } - targetURL := sURLs.TargetContent.URL - // We are not removing incomplete uploads. isIncomplete := false - // Remove extraneous file on target. - removeSingle(targetURL.String(), isIncomplete, isFake, 0) + // Construct proper path with alias. + targetWithAlias := filepath.Join(sURLs.TargetAlias, sURLs.TargetContent.URL.Path) - return sURLs.WithError(nil) + // Remove extraneous file on target. + err := probe.NewError(removeSingle(targetWithAlias, isIncomplete, isFake, 0)) + return sURLs.WithError(err) } // doMirror - Mirror an object to multiple destination. URLs status contains a copy of sURLs and error if any.