Skip to content

Commit

Permalink
rgw: fix empty storage class on display of multipart uploads
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ivancich committed Oct 22, 2024
1 parent ee6523b commit eab096c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cls/rgw/cls_rgw_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,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);
Expand Down

0 comments on commit eab096c

Please sign in to comment.