Skip to content

Commit

Permalink
Merge pull request #38 from yjinjo/master
Browse files Browse the repository at this point in the history
Modify additional info to Unknown for default value
  • Loading branch information
yjinjo authored May 29, 2024
2 parents 1569db3 + 70c5ade commit 61af15a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/plugin/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,28 +225,26 @@ def _make_additional_info(result: dict, service_account_id: str) -> dict:
if cluster := result["metric"].get("cluster"):
additional_info["Cluster"] = cluster

if node := result["metric"].get("node", "Cluster - Node"):
if node := result["metric"].get("node"):
additional_info["Node"] = node

if namespace := result["metric"].get("namespace", "Cluster - Namespace"):
if namespace := result["metric"].get("namespace"):
additional_info["Namespace"] = namespace

if pod := result["metric"].get("pod", "Cluster - Pod"):
if pod := result["metric"].get("pod"):
additional_info["Pod"] = pod

if container := result["metric"].get("container", "Cluster - Container"):
if container := result["metric"].get("container"):
additional_info["Container"] = container

if pv := result["metric"].get("persistentvolume", "Cluster - PV"):
if pv := result["metric"].get("persistentvolume"):
additional_info["PV"] = pv

if service := result["metric"].get("service_name", "Cluster - Load Balancer"):
if service := result["metric"].get("service_name"):
additional_info["Load Balancer"] = service

if result["metric"].get("type") == "idle":
additional_info["Idle"] = "__idle__"
else:
additional_info["Idle"] = "Cluster - Idle"

return additional_info

Expand Down

0 comments on commit 61af15a

Please sign in to comment.