Skip to content

Commit

Permalink
feat: check for tilde
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollorion committed Jun 12, 2024
1 parent 93b22b8 commit d425cd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spacemk/exporters/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from spacemk import get_tmp_subfolder, is_command_available
from spacemk.exporters import BaseExporter


class TerraformExporterPlanError(Exception):
def __init__(self, organization_id: str, workspace_id: str):
message = f"Could not trigger a plan for the '{organization_id}/{workspace_id}' workspace"
Expand Down Expand Up @@ -187,7 +186,10 @@ def _check_workspaces_data(self, data: list[dict]) -> list[dict]:
warnings.append("No VCS configuration")

try:
if semver.match(item.get("attributes.terraform-version"), ">=1.5.7"):
tf_version = item.get("attributes.terraform-version")
if tf_version.startsWith("~>"):
tf_version = tf_version.removeprefix("~>")
if semver.match(tf_version, ">=1.5.7"):
warnings.append("BSL Terraform version")
except BaseException:
warnings.append("Invalid Terraform version")
Expand Down

0 comments on commit d425cd5

Please sign in to comment.