Skip to content

Commit

Permalink
[COST-5331] Convert memory recommendation to MiB (#133)
Browse files Browse the repository at this point in the history
* ROS list endpoint only returns bytes for memory so convert to MiB
  • Loading branch information
chambridge authored Sep 4, 2024
1 parent a2d55e5 commit aed8142
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion costemailer/reporting/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ def get_resource_dict(resource_def):
value = res_detail.get("amount")
format = res_detail.get("format")
if format:
value = f"{value} {format}"
if format == "bytes":
convert_bytes_to_mib = value / (1024 * 1024)
value = f"{convert_bytes_to_mib} MiB"
else:
value = f"{value} {format}"
res_dict[def_item][res_type] = value
return res_dict

Expand Down

0 comments on commit aed8142

Please sign in to comment.