Skip to content

Commit

Permalink
chore: remove idle tag
Browse files Browse the repository at this point in the history
Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed May 8, 2024
1 parent 01c33ce commit 4eacd52
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/plugin/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,25 @@ def _check_required_fields(result: dict):
@staticmethod
def _make_additional_info(result: dict, service_account_id: str) -> dict:
additional_info = {
"Cluster": result["metric"].get("cluster", "__idle__"),
"X-Scope-OrgID": service_account_id,
}

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

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

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

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

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

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

return additional_info
Expand Down

0 comments on commit 4eacd52

Please sign in to comment.