From 77dd558b95f6fa9ea18680501d7e03b22e949001 Mon Sep 17 00:00:00 2001 From: Amit Prinz Setter Date: Mon, 6 Jan 2025 11:01:27 -0800 Subject: [PATCH] bucket notifications - fix TopicConfiguration array for get (github issue 8647) Signed-off-by: Amit Prinz Setter --- src/endpoint/s3/ops/s3_get_bucket_notification.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/endpoint/s3/ops/s3_get_bucket_notification.js b/src/endpoint/s3/ops/s3_get_bucket_notification.js index 5106ce91ff..b18dcf0623 100644 --- a/src/endpoint/s3/ops/s3_get_bucket_notification.js +++ b/src/endpoint/s3/ops/s3_get_bucket_notification.js @@ -13,6 +13,8 @@ async function get_bucket_notification(req) { }); result = _.cloneDeep(result); + + const TopicConfiguration = []; //adapt to aws cli structure if (result && result.length > 0) { @@ -23,20 +25,20 @@ async function get_bucket_notification(req) { delete conf.event; delete conf.topic; delete conf.id; + + TopicConfiguration.push({TopicConfiguration: conf}); } } const reply = result && result.length > 0 ? { //return result inside TopicConfiguration tag - NotificationConfiguration: { - TopicConfiguration: result - } + NotificationConfiguration: + TopicConfiguration } : //if there's no notification, return empty NotificationConfiguration tag { NotificationConfiguration: {} }; - return reply; }