]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #63089 from smanjara/wip-fix-object-lock-rule wip-alimasa-standalone-fix-s3
authoranrao19 <83442624+anrao19@users.noreply.github.com>
Wed, 17 Sep 2025 05:44:38 +0000 (11:14 +0530)
committerGitHub <noreply@github.com>
Wed, 17 Sep 2025 05:44:38 +0000 (11:14 +0530)
rgw/multisite: sync put-object-lock-configuration

1  2 
src/rgw/rgw_common.cc
src/rgw/rgw_object_lock.cc
src/rgw/rgw_object_lock.h
src/test/rgw/rgw_multi/tests.py

index ed6208f348c68f5aa95bc117c7cd8b42c480cbee,d4da8fc7fc688d4c1f3380f1ead1c029a9c4561c..97b33d6ba7f38f0d12fc28f3dbb6778b75d67ee1
@@@ -2655,20 -2649,22 +2658,23 @@@ void RGWBucketInfo::decode_json(JSONOb
    if (!sp.empty()) {
      set_sync_policy(std::move(sp));
    }
+   if (obj_lock_enabled()) {
+     JSONDecoder::decode_json("obj_lock", obj_lock, obj);
+   }
  }
  
 -void RGWUserInfo::generate_test_instances(list<RGWUserInfo*>& o)
 +list<RGWUserInfo> RGWUserInfo::generate_test_instances()
  {
 -  RGWUserInfo *i = new RGWUserInfo;
 -  i->user_id = "user_id";
 -  i->display_name =  "display_name";
 -  i->user_email = "user@email";
 -  i->account_id = "RGW12345678901234567";
 -  i->path = "/";
 -  i->create_date = ceph::real_time{std::chrono::hours(1)};
 -  i->tags.emplace("key", "value");
 -  i->group_ids.insert("group");
 +  list<RGWUserInfo> o;
 +  RGWUserInfo i;
 +  i.user_id = "user_id";
 +  i.display_name =  "display_name";
 +  i.user_email = "user@email";
 +  i.account_id = "RGW12345678901234567";
 +  i.path = "/";
 +  i.create_date = ceph::real_time{std::chrono::hours(1)};
 +  i.tags.emplace("key", "value");
 +  i.group_ids.insert("group");
    RGWAccessKey k1, k2;
    k1.id = "id1";
    k1.key = "key1";
index 6b0bd0232a3b4795a89c007dffa0f5ae97328fd6,1853d84ccef78174b08f429ca19335baba188f13..0cc88f2b27312ae3a56bbe515734df40743cc457
@@@ -44,17 -54,22 +54,23 @@@ void ObjectLockRule::dump_xml(Formatte
  }
  
  void ObjectLockRule::dump(Formatter *f) const {
-   f->open_object_section("default_retention");
-   defaultRetention.dump(f);
-   f->close_section();
+   encode_json("defaultRetention", defaultRetention, f);
  }
  
 -void ObjectLockRule::generate_test_instances(std::list<ObjectLockRule*>& o) {
 -  ObjectLockRule *obj = new ObjectLockRule;
 -  o.push_back(obj);
 +std::list<ObjectLockRule> ObjectLockRule::generate_test_instances() {
 +  std::list<ObjectLockRule> o;
 +  o.emplace_back();
 +  return o;
  }
  
+ void RGWObjectLock::decode_json(JSONObj *obj) {
+   JSONDecoder::decode_json("enabled", enabled, obj);
+   JSONDecoder::decode_json("rule_exist", rule_exist, obj);
+   if (rule_exist) {
+     JSONDecoder::decode_json("rule", rule, obj);
+   }
+ }
  void RGWObjectLock::decode_xml(XMLObj *obj) {
    string enabled_str;
    RGWXMLDecoder::decode_xml("ObjectLockEnabled", enabled_str, obj, true);
index cb6aa5669757e4046dc33191a824f678223e5335,cdfdbc7681c4c5ed8b5d6a7a21acac9b6c63a03f..645b6cdbb777b3679b6743831f31f71977926ee8
@@@ -4,9 -4,9 +4,10 @@@
  #pragma once
  
  #include <string>
 +#include "include/encoding.h"
  #include "common/ceph_time.h"
  #include "common/iso_8601.h"
+ #include "common/ceph_json.h"
  #include "rgw_xml.h"
  
  class DefaultRetention
Simple merge