Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tofo init cannot find module version with a suffix #1094

Open
c-baumgartner opened this issue Oct 7, 2024 · 3 comments
Open

tofo init cannot find module version with a suffix #1094

c-baumgartner opened this issue Oct 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@c-baumgartner
Copy link

c-baumgartner commented Oct 7, 2024

Thank you for reporting an issue.

Trying to use module Azure/avm-ptn-alz/azurerm I have a strange behavior. Without a version constraint it will always use version 0.8.1

Trying specifing the version manually to v0.9.0-beta2 will result in the following error:

╷
│ Error: Unresolvable module version constraint
│ 
│   on main.tf line 8:
│    8: module "alz_architecture" {
│ 
│ There is no available version of module "registry.opentofu.org/Azure/avm-ptn-alz/azurerm" (main.tf:8) which matches the given version constraint. The newest available version is 0.8.1.
╵

Looking into the azurerm.json in the module catalog the beta-versions are available (only an excerpt from the file):

{
  "versions": [
    {
      "version": "v0.9.0-beta2"
    },
    {
      "version": "v0.9.0-beta"
    },
    {
      "version": "v0.8.1"
    }]
}

OpenTofu Version

OpenTofu v1.8.2
on linux_amd64

OpenTofu Configuration Files

module "alz_architecture" {
  source  = "Azure/avm-ptn-alz/azurerm"
  version = "v0.9.0-beta"

  architecture_name  = "alz"
  parent_resource_id = data.azapi_client_config.current.tenant_id
  location           = local.location
}
@c-baumgartner c-baumgartner added the bug Something isn't working label Oct 7, 2024
@ollevche
Copy link
Member

ollevche commented Oct 7, 2024

Hey @c-baumgartner thank you for the issue! I believe you shouldn't specify the v prefix in module version so version = "v0.9.0-beta" becomes version = "0.9.0-beta". However, I agree error message doesn't make it clear at all.

@c-baumgartner
Copy link
Author

Hi @ollevche - thank you for pointing that out - fun fact: Using "v0.8.1" ist working without any issue. It only fails for the version with the "-beta" suffix. The versions in the azurerm.json file are using the "v" too :-) So yeah, really confusing. But without the "v" it is working also for the -beta version constraint....

@ollevche ollevche added enhancement New feature or request and removed bug Something isn't working labels Oct 7, 2024
@ollevche
Copy link
Member

ollevche commented Oct 7, 2024

@c-baumgartner I agree, that's inconsistent. We will discuss this issue at the core team triage meeting and hopefully change the error message or parsing logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants