From 080f9aee78595a102ca4509d8982c3f8f33b8556 Mon Sep 17 00:00:00 2001 From: apollorion Date: Fri, 2 Aug 2024 16:10:08 -0400 Subject: [PATCH] feat: fix version constraint --- spacemk/exporters/terraform.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spacemk/exporters/terraform.py b/spacemk/exporters/terraform.py index 6b380b9..c5b8ad3 100644 --- a/spacemk/exporters/terraform.py +++ b/spacemk/exporters/terraform.py @@ -1285,15 +1285,15 @@ def find_workspace_variable_with_invalid_name(data: dict, workspace_id: str, typ vcs_repository = None terraform_version = workspace.get("attributes.terraform-version") - if terraform_version == "latest": - # KLUDGE: Stick to the latest MPL-licensed Terraform version for now - terraform_version = "1.5.7" - - if semver.match(workspace.get("attributes.terraform-version"), ">=1.5.7"): + if terraform_version != "latest" and semver.match(terraform_version, ">=1.5.7"): terraform_workflow_tool = "CUSTOM" else: terraform_workflow_tool = "TERRAFORM_FOSS" + if terraform_version == "latest": + # KLUDGE: Stick to the latest MPL-licensed Terraform version for now + terraform_version = "1.5.7" + if "relationships.project.data.id" in workspace: space_id = workspace.get("relationships.project.data.id") else: