From b9e63ae4bbc020e285be543c1decb953f148a59b Mon Sep 17 00:00:00 2001 From: Matt Gowie Date: Thu, 12 Dec 2024 19:48:03 -0500 Subject: [PATCH] fix: common labels merge with stack labels --- aqua.yaml | 1 + .../components/spacelift-automation/stacks/common.yaml | 2 ++ .../components/spacelift-automation/stacks/example.yaml | 2 ++ main.tf | 3 +++ 4 files changed, 8 insertions(+) diff --git a/aqua.yaml b/aqua.yaml index 800bfdd..0040018 100644 --- a/aqua.yaml +++ b/aqua.yaml @@ -13,3 +13,4 @@ packages: - name: terraform-docs/terraform-docs@v0.18.0 - name: hashicorp/terraform@v1.9.3 - name: opentofu/opentofu@v1.8.0 + - name: spacelift-io/spacectl@v1.8.0 diff --git a/examples/complete/components/spacelift-automation/stacks/common.yaml b/examples/complete/components/spacelift-automation/stacks/common.yaml index 69b675a..71b1ba6 100644 --- a/examples/complete/components/spacelift-automation/stacks/common.yaml +++ b/examples/complete/components/spacelift-automation/stacks/common.yaml @@ -1,3 +1,5 @@ stack_settings: administrative: true aws_integration_enabled: true + labels: + - common_label diff --git a/examples/complete/components/spacelift-automation/stacks/example.yaml b/examples/complete/components/spacelift-automation/stacks/example.yaml index 6256f9e..4b8bbc5 100644 --- a/examples/complete/components/spacelift-automation/stacks/example.yaml +++ b/examples/complete/components/spacelift-automation/stacks/example.yaml @@ -1,2 +1,4 @@ stack_settings: description: This Automation stack is used for Masterpoint's testing purposes + labels: + - stack_specific_label diff --git a/main.tf b/main.tf index 1da3aa7..2b5a9b3 100644 --- a/main.tf +++ b/main.tf @@ -226,6 +226,9 @@ module "deep" { for_each = local._root_module_stack_configs # Stack configuration will take precedence and overwrite the conflicting value from the common configuration (if any) maps = [local._common_configs[each.value.root_module], each.value] + + # To support merging labels from common.yaml, we need lists to append instead of overwrite + append_list_enabled = true } resource "spacelift_stack" "default" {