Skip to content

Commit

Permalink
[COST-4759] Add all_labels to back populate for ocp on cloud. (#5001)
Browse files Browse the repository at this point in the history
  • Loading branch information
myersCody authored Apr 26, 2024
1 parent ffae50c commit 45683f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
resource_id,
pod_labels,
volume_labels,
all_labels,
source_uuid,
infrastructure_raw_cost,
infrastructure_project_raw_cost,
Expand Down Expand Up @@ -60,6 +61,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
THEN ocp_aws.pod_labels
ELSE '{}'::jsonb
END as volume_labels,
ocp_aws.pod_labels as all_labels,
rp.provider_id as source_uuid,
{% if is_savingsplan_cost %}
sum(coalesce(nullif(ocp_aws.savingsplan_effective_cost, 0), ocp_aws.unblended_cost) + coalesce(nullif(ocp_aws.markup_cost_savingsplan, 0), ocp_aws.markup_cost)) AS infrastructure_raw_cost,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
resource_id,
pod_labels,
volume_labels,
all_labels,
source_uuid,
infrastructure_raw_cost,
infrastructure_project_raw_cost,
Expand Down Expand Up @@ -59,6 +60,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
THEN ocp_azure.pod_labels
ELSE '{}'::jsonb
END as volume_labels,
ocp_azure.pod_labels as all_labels,
rp.provider_id as source_uuid,
sum(ocp_azure.pretax_cost + ocp_azure.markup_cost) AS infrastructure_raw_cost,
sum(ocp_azure.pod_cost + ocp_azure.project_markup_cost) AS infrastructure_project_raw_cost,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
resource_id,
pod_labels,
volume_labels,
all_labels,
cost_category_id,
source_uuid,
infrastructure_raw_cost,
Expand Down Expand Up @@ -59,6 +60,7 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
THEN ocp_gcp.pod_labels
ELSE '{}'::jsonb
END as volume_labels,
ocp_gcp.pod_labels as all_labels,
max(ocp_gcp.cost_category_id) as cost_category_id,
rp.provider_id as source_uuid,
sum(ocp_gcp.unblended_cost + ocp_gcp.markup_cost + ocp_gcp.credit_amount) AS infrastructure_raw_cost,
Expand Down

0 comments on commit 45683f9

Please sign in to comment.