]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: expect vault returns key detail on key creation
authorSeena Fallah <seenafallah@gmail.com>
Tue, 22 Apr 2025 08:13:42 +0000 (10:13 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Fri, 3 Oct 2025 12:11:39 +0000 (14:11 +0200)
Vault will return the key detail on creation. no need to log an error
for that.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
src/rgw/rgw_kms.cc

index e9b22da1d2bbece45472909b7f3ae631c3c79b6c..27c8d50e2ce67c08405e2d0474aad22d221fc1fb 100644 (file)
@@ -503,6 +503,8 @@ public:
     int res = send_request(dpp, "POST", "/datakey/plaintext/", key_id,
                            post_data, y, secret_bl);
     if (res < 0) {
+      ldpp_dout(dpp, 0) << "ERROR: Failed to send request to Vault, res: "
+                        << res << " response: " << string_view(secret_bl.c_str(), secret_bl.length()) << dendl;
       return res;
     }
 
@@ -588,6 +590,8 @@ public:
     int res = send_request(dpp, "POST", "/decrypt/", key_id,
                            post_data, y, secret_bl);
     if (res < 0) {
+      ldpp_dout(dpp, 0) << "ERROR: Failed to send request to Vault for decrypt, res: "
+                        << res << " response: " << string_view(secret_bl.c_str(), secret_bl.length()) << dendl;
       return res;
     }
 
@@ -656,12 +660,11 @@ public:
     int res = send_request(dpp, "POST", "/keys/", key_name,
                            post_data, y, dummy_bl);
     if (res < 0) {
-      return res;
-    }
-    if (dummy_bl.length() != 0) {
-      ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault making a key: "
+      ldpp_dout(dpp, 0) << "ERROR: key creation failed by Vault, ret: "
+        << res << " response: "
         << std::string_view(dummy_bl.c_str(), dummy_bl.length())
         << dendl;
+      return res;
     }
     return 0;
   }