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

Correct provider version isn't used #16

Open
1 task
nihaals opened this issue Aug 26, 2024 · 2 comments
Open
1 task

Correct provider version isn't used #16

nihaals opened this issue Aug 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nihaals
Copy link

nihaals commented Aug 26, 2024

Language Server Version

v0.2.0

Terraform Version

OpenTofu v1.8.1

Client Version

Neovim v0.10.1

Terraform Configuration

terraform {
  required_providers {
    cloudflare = {
      source = "cloudflare/cloudflare"
      version = "4.40.0"
    }
  }
}

resource "cloudflare_record" "a" {}

Steps to Reproduce

  1. Create main.tf with the above contents
  2. tofu init
  3. Close and re-open the file
  4. Hover over cloudflare_record
  5. Notice cloudflare 4.38.0 is used
  6. Notice tofu providers schema -json includes 4.40.0 features e.g. cloudflare_zero_trust_access_application
  7. terraform init
  8. Use terraform-ls 0.34.2
  9. Notice it uses cloudflare 4.40.0

In VSCode it shows cloudflare 3.29.0.

Expected Behavior

It uses cloudflare 4.40.0 (matching the provider version being used).

Actual Behavior

It uses cloudflare 4.38.0 which is not being used.

Gist

No response

Workarounds

I haven't found any.

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@nihaals nihaals added the bug Something isn't working label Aug 26, 2024
@nihaals
Copy link
Author

nihaals commented Aug 26, 2024

Initially I thought it might still be trying to use a Terraform version but even after terraform init opentofu-ls uses the old version. It seems to be based on some kind of cache as another provider is using an outdated version based on when I first added it but I don't have global plugin cache enabled.

@nihaals
Copy link
Author

nihaals commented Aug 26, 2024

Actually just realised that if you specify the registry in required_providers it works properly so it does seem to be based on an old mention of the Terraform registry.

@github-staff github-staff deleted a comment from Lxx-c Oct 23, 2024
@github-staff github-staff deleted a comment from Lxx-c Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@nihaals and others