From 1859239347ded50ff5e77404ae4104c0fba5013b Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 26 Jan 2015 17:31:10 -0800 Subject: [PATCH] rgw-admin: set explicit "null" instance when needed When clearing a bucket, if instance is not found, set it to "null", otherwise we'll just create a delete marker. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_bucket.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index c60659e3221..7cfc7dec737 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -372,6 +372,10 @@ int rgw_remove_object(RGWRados *store, RGWBucketInfo& bucket_info, rgw_bucket& b { RGWObjectCtx rctx(store); + if (key.instance.empty()) { + key.instance = "null"; + } + rgw_obj obj(bucket, key); int ret = store->delete_obj(rctx, bucket_info, obj, bucket_info.versioning_status()); -- 2.47.3