For backward compatibility, so that older rgws could handle it appropriately.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw_bucket source_bucket;
- if (source_key.empty()) {
+ if (source_key.empty() ||
+ source_key == key) {
source_bucket = info.bucket;
} else {
http_ret = rgw_bucket_parse_bucket_key(s->cct, source_key, &source_bucket, nullptr);
{ "type", "bucket-index" },
{ "status", nullptr },
{ "options", "merge" },
- { "source-bucket", bucket_instance.c_str() },
+ { "bucket", bucket_instance.c_str() }, /* equal to source-bucket when `options==merge` and source-bucket
+ param is not provided */
{ "source-zone", zone_id.c_str() },
{ nullptr, nullptr }
};