]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix empty storage class on display of multipart uploads
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 22 Oct 2024 17:17:14 +0000 (13:17 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 2 Jul 2025 20:53:07 +0000 (16:53 -0400)
Some multipart uploads do not have a stored storage class, however the
code is written such that an empty storage class is treated as the
"STANDARD" storage class. So when encoding the storage class in JSON,
use the canonical storage.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit eab096c188d2430ccc3e865b614b845f1a92af08)

src/cls/rgw/cls_rgw_types.cc

index a441fcc36aaca15246c190350578768a0a78b405..9e4904de5ab7d77b5496a1fafe8220b6ee6629b5 100644 (file)
@@ -180,7 +180,9 @@ void rgw_bucket_dir_entry_meta::dump(Formatter *f) const
   utime_t ut(mtime);
   encode_json("mtime", ut, f);
   encode_json("etag", etag, f);
-  encode_json("storage_class", storage_class, f);
+  encode_json("storage_class",
+             rgw_placement_rule::get_canonical_storage_class(storage_class),
+             f);
   encode_json("owner", owner, f);
   encode_json("owner_display_name", owner_display_name, f);
   encode_json("content_type", content_type, f);