]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_sync_module_es.cc
update sources to v12.1.1
[ceph.git] / ceph / src / rgw / rgw_sync_module_es.cc
index 484352dc835cb53319dfcb2b340686634283d36e..6c8c65c5a14cc3f8f8e6cded4cacdbb89e89636f 100644 (file)
@@ -263,6 +263,7 @@ struct es_obj_metadata {
     map<string, string> custom_meta;
     RGWAccessControlPolicy policy;
     set<string> permissions;
+    RGWObjTags obj_tags;
 
     for (auto i : attrs) {
       const string& attr_name = i.first;
@@ -302,6 +303,9 @@ struct es_obj_metadata {
             }
           }
         }
+      } else if (name == "x-amz-tagging") {
+        auto tags_bl = val.begin();
+        ::decode(obj_tags, tags_bl);
       } else {
         if (name != "pg_ver" &&
             name != "source_zone" &&
@@ -396,7 +400,18 @@ struct es_obj_metadata {
       }
       f->close_section();
     }
-    f->close_section();
+    f->close_section(); // meta
+    const auto& m = obj_tags.get_tags();
+    if (m.size() > 0){
+      f->open_array_section("tagging");
+      for (const auto &it : m) {
+        f->open_object_section("tag");
+        ::encode_json("key", it.first, f);
+        ::encode_json("value",it.second, f);
+        f->close_section();
+      }
+      f->close_section(); // tagging
+    }
   }
 };