Fix Terraform 1.6 compat by finishing GetMetadata implementation #1089
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1088
Providers implemented using the
terraform-plugin-go
library above version 0.19 or so must implement GetMetadata(), as part of supporting an optional memory usage improvement. Seehashicorp/terraform-plugin-sdk#1234 for the start of a breadcrumb trail with more details about this whole effort.
Almost nobody actually implements providers using terraform-plugin-go, but we do! It's one of our THREE muxed-together providers, because we once needed to do something that was impossible in the SDK before the new framework existed. It's used for ONE data source,
tfe_outputs
.This function was added (with a blank return value) in #1046 and no one noticed a problem, presumably because acceptance tests were running with a Terraform version that didn't exercise the new memory-saving code path, instead just calling GetProviderSchema however many times.
But, Terraform 1.6 does exercise it, and it turns out a blank value causes it to bail out early with a not-found for the tfe_outputs data source.
This commit adds our lonely data source to the low-level provider's metadata, which fixes the issue. Longer-term, we should... probably migrate that data source to the framework and delete that whole third provider.
Remember to:
Testing plan
Swap in your own organization and workspace names as needed, but here, try this:
Since I always forget how to do dev overrides:
TF_CLI_CONFIG_FILE=~/.terraformrc-dev-overrides
Output from acceptance tests
I work here, so see CI output.