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

terraform: Fix required version constraint diags #25898

Merged
merged 1 commit into from
Aug 19, 2020

Commits on Aug 18, 2020

  1. terraform: Fix required version constraint diags

    If a module has multiple terraform.required_version constraints, any
    failures would point at the last constraint in the error diagnostics. If
    an earlier constraint was the actual problem, this leads to confusing
    errors like this:
    
        Error: Unsupported Terraform Core version
    
          on main.tf line 6, in terraform:
           6:   required_version = ">= 0.13.0"
    
        This configuration does not support Terraform version 0.13.0.
    
    The error was due to storing the declaration range of the constraint as
    a pointer to the contents of a loop variable, which was later
    overwritten in later iterations of the loop.  Instead we now use HCL's
    handy Ptr() method to create a direct pointer to the range struct.
    alisdair committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    c98f352 View commit details
    Browse the repository at this point in the history