terraform/plugin
Paddy Carver c840e9c4bc Fix empty diags not getting associated with source.
Right now, there's a bug that if a diagnostic comes back from the
provider with an AttributePath set, but no steps in the AttributePath,
Terraform _thinks_ it's an attribute-specific diagnostic and not a
whole-resource diagnostic, but then doesn't associate it with any
specific attribute, meaning the diagnostic doesn't get associated with
the config at all.

This PR changes things to check if there are any steps in the
AttributePath before deciding this isn't a whole-resource diagnostic,
and if there aren't, treats it as a whole-resource diagnostic, instead.

See hashicorp/terraform-plugin-sdk#561 for more details on how this
surfaces in the wild.
2021-02-08 10:44:30 -08:00
..
convert Fix empty diags not getting associated with source. 2021-02-08 10:44:30 -08:00
discovery plugin/discovery: staticcheck 2020-12-02 13:59:19 -05:00
mock_proto Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
grpc_error.go make grpcErr work for either plugin type 2020-10-26 09:34:03 -04:00
grpc_provider.go make grpcErr work for either plugin type 2020-10-26 09:34:03 -04:00
grpc_provider_test.go handle empty json 2020-10-19 09:31:37 -04:00
grpc_provisioner.go make grpcErr work for either plugin type 2020-10-26 09:34:03 -04:00
grpc_provisioner_test.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
plugin.go remove netrpc plugins 2020-12-02 13:07:10 -05:00
serve.go remove netrpc plugins 2020-12-02 13:07:10 -05:00
ui_input.go don't use legacy import for the UIInput interface 2020-12-02 15:44:58 -05:00
ui_input_test.go don't use legacy import for the UIInput interface 2020-12-02 15:44:58 -05:00
ui_output.go don't use legacy import for the UIInput interface 2020-12-02 15:44:58 -05:00
ui_output_test.go don't use legacy import for the UIInput interface 2020-12-02 15:44:58 -05:00