terraform/internal/plugin
Martin Atkins a77d351ea2 plugin+plugin6: Don't panic if ProviderMeta not populated
"ProviderMeta" is a niche feature that's used by only two providers, but
this code was written under the assumption that the caller would always
provide it for any provider that has a schema for it, and unfortunately
the Terraform SDK seems to always provide a meta schema even for providers
that don't use it, and thus it's empty.

The current phase of the "unknown_instances" language experiment is not
fully wired in to the main logic as a way to reduce the risk of it
impacting behavior for those not participating in the experiment, but
that means that right now it doesn't actually have a resolved ProviderMeta
value to present, and so was just omitting it on the assumption that it
is always optional to provide anyway.

As a pragmatic stopgap to resolve that conflict, this makes the gRPC
provider dispatching logic tolerate an absent ProviderMeta value and
synthesize a null value to use in that case. This makes that logic slightly
more robust and also means we can defer doing all of the work to weave
ProviderMeta into this experimental codepath. The new TODO comment in that
codepath is intended to remind us to consider this again should we decide
to stablize the experiment later; when we do that, we'll hopefully do it
by refactoring to share more code between the two codepaths, at which
point ProviderMeta will be easier to support.
2024-02-13 16:40:07 -08:00
..
convert Add missing function deprecation_message to JSON output and website documentation (#34520) 2024-01-12 14:49:38 -05:00
discovery Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
mock_proto Add support for the cross resource type move operation in the proto schema (#34480) 2024-01-11 10:08:50 +01:00
grpc_error.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
grpc_provider.go plugin+plugin6: Don't panic if ProviderMeta not populated 2024-02-13 16:40:07 -08:00
grpc_provider_test.go Support Private State with MoveResourceState (#34575) 2024-01-26 07:46:31 -05:00
grpc_provisioner.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
grpc_provisioner_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
plugin.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
serve.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
ui_input.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
ui_input_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
ui_output.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
ui_output_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00