opentofu/plugin
Martin Atkins bdcac8792d plugin: Use correct schema when marshaling imported resource objects
Previously we were using the type name requested in the import to select
the schema, but a provider is free to return additional objects of other
types as part of an import result, and so it's important that we perform
schema selection separately for each returned object.

If we don't do this, we get confusing downstream errors where the
resulting object decodes to the wrong type and breaks various invariants
expected by Terraform Core.

The testResourceImportOther test in the test provider didn't catch this
previously because it happened to have an identical schema to the other
resource type being imported. Now the schema is changed and also there's
a computed attribute we can set as part of the refresh phase to make sure
we're completing the Read call properly during import. Refresh was working
correctly, but we didn't have any tests for it as part of the import flow.
2019-02-01 15:22:54 -08:00
..
convert providers: Consistently use int64 for schema versions 2018-11-30 11:22:39 -08:00
discovery Bump installer protocol version to 5 and separate client and server protocol references 2019-01-16 15:07:57 -06:00
mock_proto generate new plugin proto mocks 2018-12-10 17:16:13 -05:00
client.go enable Auto mTLS in go-plugin 2018-12-05 20:30:16 -05:00
grpc_provider_test.go plugin: Establish our current plugin protocol as version 5 2018-11-19 09:56:41 -08:00
grpc_provider.go plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
grpc_provisioner_test.go plugin: Establish our current plugin protocol as version 5 2018-11-19 09:56:41 -08:00
grpc_provisioner.go plugin: Establish our current plugin protocol as version 5 2018-11-19 09:56:41 -08:00
plugin_test.go Use hashicorp/go-plugin for plugin system 2016-05-10 14:14:47 -04:00
plugin.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00
resource_provider_test.go plugin: Fix tests 2018-10-16 19:14:11 -07:00
resource_provider.go serve the new version 5 grpc plugins 2018-10-16 18:58:49 -07:00
resource_provisioner_test.go plugin: Fix tests 2018-10-16 19:14:11 -07:00
resource_provisioner.go serve the new version 5 grpc plugins 2018-10-16 18:58:49 -07:00
serve.go Bump installer protocol version to 5 and separate client and server protocol references 2019-01-16 15:07:57 -06:00
ui_input_test.go Use hashicorp/go-plugin for plugin system 2016-05-10 14:14:47 -04:00
ui_input.go Use hashicorp/go-plugin for plugin system 2016-05-10 14:14:47 -04:00
ui_output_test.go Use hashicorp/go-plugin for plugin system 2016-05-10 14:14:47 -04:00
ui_output.go Use hashicorp/go-plugin for plugin system 2016-05-10 14:14:47 -04:00