terramate-io/terramate

[BUG] `required_version` validation error

Closed this issue · 2 comments

Describe the bug

Version constraint ">= 0.9.0" is not satisfied by terramate version "0.9.1-dev"

To Reproduce

> GOBIN=~/bin/ go install github.com/terramate-io/terramate/cmd/terramate@i4k-fix-tg-after-cycle
❯ ~/bin/terramate create --all-terragrunt
Error: version check failed
> version check error: version constraint ">= 0.9.0" not satisfied by terramate version "0.9.1-dev"

Expected behavior

Version constraint is accepted and Terramate execution continues.

Additional context

terramate.tm.hcl:

terramate {
  required_version = ">= 0.9.0"

  config {
    change_detection {
      terragrunt = "force"
    }

    generate {
      hcl_magic_header_comment_style = "#"
    }

    disable_safeguards = ["git"]

    git {
      default_branch = "master"
      default_remote = "origin"
    }
  }
}

https://jubianchi.github.io/semver-check/#/%3E%3D%200.9.0/0.9.1-dev says it is valid and that's my understanding too.

Hi @ohmer, thanks for reporting this. To allow pre-releases in required_version you need to set terramate.required_version_allow_prereleases to true.

So your configuration would look something like this

terramate.tm.hcl

terramate {
  required_version = ">= 0.9.0"
  required_version_allow_prereleases = true

  config {
    change_detection {
      terragrunt = "force"
    }

    generate {
      hcl_magic_header_comment_style = "#"
    }

    disable_safeguards = ["git"]

    git {
      default_branch = "master"
      default_remote = "origin"
    }
  }
}

Let me know if that solves your problem!

So that's not a bug but PEBKAC ;-)
Thanks for clarifying, I forgot about required_version_allow_prereleases.