From: Seena Fallah Date: Mon, 22 Apr 2024 21:16:28 +0000 (+0200) Subject: rgw: false assumption on vault bucket key deletion X-Git-Tag: testing/wip-rishabh-testing-20250315.120910-debug~9^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=094bfc535eb0b54b1d4fcff3931affdb2c6e7785;p=ceph-ci.git rgw: false assumption on vault bucket key deletion On bucket key deletion when the request to change the property of the key for deletion_allowed to true, it is expected that the response body be empty. But this assumption is false and there would be a dump of the new config in the response. this condition would prevent the key deletion to be done. Fixes: https://tracker.ceph.com/issues/65626 Signed-off-by: Seena Fallah --- diff --git a/src/rgw/rgw_kms.cc b/src/rgw/rgw_kms.cc index cb6454b9fbc..d9b7e8848a2 100644 --- a/src/rgw/rgw_kms.cc +++ b/src/rgw/rgw_kms.cc @@ -651,8 +651,8 @@ public: } if (dummy_bl.length() != 0) { ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault making a key: " - << dummy_bl - << dendl; + << std::string_view(dummy_bl.c_str(), dummy_bl.length()) + << dendl; } return 0; } @@ -688,26 +688,22 @@ public: int res = send_request(dpp, "POST", "", config_path, post_data, y, dummy_bl); if (res < 0) { + ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete, ret: " + << res << " response: " + << std::string_view(dummy_bl.c_str(), dummy_bl.length()) + << dendl; return res; } - if (dummy_bl.length() != 0) { - ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete: " - << dummy_bl - << dendl; - return -EINVAL; - } res = send_request(dpp, "DELETE", "", delete_path, string{}, y, dummy_bl); if (res < 0) { + ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key, ret: " + << res << " response: " + << std::string_view(dummy_bl.c_str(), dummy_bl.length()) + << dendl; return res; } - if (dummy_bl.length() != 0) { - ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key: " - << dummy_bl - << dendl; - return -EINVAL; - } return 0; } };