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

fix: prevent crash for legacy provider lookups #481

Merged
merged 1 commit into from
Apr 30, 2021
Merged

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Apr 30, 2021

Fixes #479

This accounts for a case where users don't have explicit provider requirement in their configuration, but use Terraform 0.13+ (which outputs provider schemas with new addresses).

Generally ProviderSchema() is not meant to ever return nil, nil, which other logic in terraform-schema relies on:

https://github.com/hashicorp/terraform-schema/blob/ad0461b4382716039f6d35e8fd9bd8599458285c/schema/schema_merge.go#L70-L77

I also added some extra logging in "hot paths" which users are likely to hit and where knowing more may aid debugging in the future.

Legacy addresses will unfortunately not be eliminated in the near future, despite how we refer to them (legacy) as there's currently no plan for making explicit source argument required in Terraform v1.

We can guide people to help eliminate it #480 and convert legacy addresses ourselves #458

Regardless though we need to be able to deal with such legacy addresses in the meantime.

@radeksimko radeksimko added the bug Something isn't working label Apr 30, 2021
@radeksimko radeksimko merged commit 9209786 into main Apr 30, 2021
@radeksimko radeksimko deleted the b-schema-nil-crash branch April 30, 2021 16:59
@ghost
Copy link

ghost commented May 30, 2021

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 as resolved and limited conversation to collaborators May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform Language Server v.0.16.0 keeps crashing after upgrade to v.2.10.1
2 participants