attr is optional for mc pipe

fixes #3718
This commit is contained in:
Harshavardhana
2021-05-12 09:27:36 -07:00
parent 7d142be711
commit 60d3646baf
+5 -2
View File
@@ -135,8 +135,11 @@ func mainPipe(ctx *cli.Context) error {
// validate pipe input arguments.
checkPipeSyntax(ctx)
meta, err := getMetaDataEntry(ctx.String("attr"))
fatalIf(err.Trace(""), "Unable to parse --attr value")
var meta = map[string]string{}
if attr := ctx.String("attr"); attr != "" {
meta, err = getMetaDataEntry(attr)
fatalIf(err.Trace(attr), "Unable to parse --attr value")
}
if tags := ctx.String("tags"); tags != "" {
meta["X-Amz-Tagging"] = tags
}