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

Make LS compatible with Terraform v0.13 #111

Closed
radeksimko opened this issue May 21, 2020 · 4 comments · Fixed by #149
Closed

Make LS compatible with Terraform v0.13 #111

radeksimko opened this issue May 21, 2020 · 4 comments · Fixed by #149
Assignees
Labels
enhancement New feature or request terraform/exec
Milestone

Comments

@radeksimko
Copy link
Member

radeksimko commented May 21, 2020

Current Version

v0.2.1

Use-cases

Terraform 0.13 will be released soon and users should be able to use LS with that version.

Proposal

One known issue is different location of the lock file, which is currently set here

func lockFilePath(dir string) string {
return filepath.Join(dir,
".terraform",
"plugins",
runtime.GOOS+"_"+runtime.GOARCH,
"lock.json")
}

the new location is apparently .terraform/plugins/selections.json - which seems platform-agnostic, so that's positive, but we may not be able to just automatically look for that new path based on Terraform version, because v0.13 doesn't seem to be moving the old lock file to the new location.

@radeksimko radeksimko added enhancement New feature or request terraform/exec labels May 21, 2020
@paultyng
Copy link
Contributor

Maybe you could just watch both versions for now?

@paultyng paultyng added this to the v0.4.0 milestone Jun 4, 2020
@paultyng
Copy link
Contributor

paultyng commented Jun 4, 2020

Since the beta is out now, probably need to bump the priority.

@apparentlymart
Copy link

apparentlymart commented Jun 5, 2020

Related to this, I notice that the language server is using hashicorp/go-version's Constraints.Check method to verify that it's working with Terraform 0.12 or later:

if !c.Check(tfVersion) {

Unfortunately go-version doesn't consider prerelease versions (like 0.13.0-beta1) as matching version a constraint unless they are specified exactly in the version constraint. (That is, the constraint would have to exactly include 0.13.0-beta1 in order to match this version.)

In order to avoid reporting beta versions as unsupported, perhaps instead it could be written as a comparison of Version values, like this:

minimumVersion := version.Must(version.NewVersion("0.12.0")
tfVersion.GreaterThanOrEqual(minimumVersion)

IIRC the prerelease special case applies to Constraints.Check specifically, and doesn't affect the precedence results indicated by the Version methods.

@ghost
Copy link

ghost commented Jul 9, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request terraform/exec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants