From 12eaa0f7b2b5a92a75b311f1893aea351eb02575 Mon Sep 17 00:00:00 2001 From: Pierre Formont Date: Fri, 8 Sep 2023 11:32:44 +0200 Subject: [PATCH 1/2] merge labels from data_merges in project factory --- blueprints/factories/project-factory/main.tf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/blueprints/factories/project-factory/main.tf b/blueprints/factories/project-factory/main.tf index 7d173a11a0..9a230063c6 100644 --- a/blueprints/factories/project-factory/main.tf +++ b/blueprints/factories/project-factory/main.tf @@ -33,11 +33,13 @@ module "projects" { iam = try(each.value.iam, {}) iam_bindings = try(each.value.iam_bindings, {}) iam_bindings_additive = try(each.value.iam_bindings_additive, {}) - labels = each.value.labels - lien_reason = try(each.value.lien_reason, null) - logging_data_access = try(each.value.logging_data_access, {}) - logging_exclusions = try(each.value.logging_exclusions, {}) - logging_sinks = try(each.value.logging_sinks, {}) + labels = merge( + each.value.labels, var.data_merges.labels + ) + lien_reason = try(each.value.lien_reason, null) + logging_data_access = try(each.value.logging_data_access, {}) + logging_exclusions = try(each.value.logging_exclusions, {}) + logging_sinks = try(each.value.logging_sinks, {}) metric_scopes = distinct(concat( each.value.metric_scopes, var.data_merges.metric_scopes )) From eecde85b5d4241ddacc36bf876d5ee7108acd8af Mon Sep 17 00:00:00 2001 From: Pierre Formont Date: Fri, 8 Sep 2023 11:56:25 +0200 Subject: [PATCH 2/2] fix project factory test for labels --- .../blueprints/factories/project_factory/examples/example.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/blueprints/factories/project_factory/examples/example.yaml b/tests/blueprints/factories/project_factory/examples/example.yaml index d1eb054eaf..086fbd55c7 100644 --- a/tests/blueprints/factories/project_factory/examples/example.yaml +++ b/tests/blueprints/factories/project_factory/examples/example.yaml @@ -33,6 +33,7 @@ values: folder_id: "12345678" labels: app: app-1 + environment: test team: foo name: test-pf-prj-app-1 org_id: null @@ -64,6 +65,7 @@ values: folder_id: "12345678" labels: app: app-1 + environment: test team: foo name: test-pf-prj-app-2 org_id: null