-
Notifications
You must be signed in to change notification settings - Fork 33
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
MsgPack doesn't handle DynamicPseudoType in complex types correctly #95
Comments
bflad
added a commit
that referenced
this issue
Aug 11, 2021
…ing DynamicPseudoType as their type when unmarshaling msgpack values from Terraform. Reference: #95 Previously: ``` --- FAIL: TestValueFromMsgPack (0.00s) --- FAIL: TestValueFromMsgPack/object-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Object["greeting":tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Object["greeting":tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) --- FAIL: TestValueFromMsgPack/map-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Map[tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Map[tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) --- FAIL: TestValueFromMsgPack/tuple-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Tuple[tftypes.String, tftypes.String]<tftypes.String<"hello">, tftypes.String<"world">>`, + s`tftypes.Tuple[tftypes.DynamicPseudoType, tftypes.DynamicPseudoType]<tftypes.String<"hello">, tftypes.String<"world">>`, ) --- FAIL: TestValueFromMsgPack/dynamic-object (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Object["greeting":tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Object["greeting":tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) ```
bflad
added a commit
that referenced
this issue
Aug 16, 2021
…ing DynamicPseudoType as their type when unmarshaling msgpack values from Terraform. (#100) Reference: #95 Previously: ``` --- FAIL: TestValueFromMsgPack (0.00s) --- FAIL: TestValueFromMsgPack/object-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Object["greeting":tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Object["greeting":tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) --- FAIL: TestValueFromMsgPack/map-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Map[tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Map[tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) --- FAIL: TestValueFromMsgPack/tuple-dynamic (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Tuple[tftypes.String, tftypes.String]<tftypes.String<"hello">, tftypes.String<"world">>`, + s`tftypes.Tuple[tftypes.DynamicPseudoType, tftypes.DynamicPseudoType]<tftypes.String<"hello">, tftypes.String<"world">>`, ) --- FAIL: TestValueFromMsgPack/dynamic-object (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack_test.go:501: Unexpected results (-wanted +got): tftypes.Value( - s`tftypes.Object["greeting":tftypes.String]<"greeting":tftypes.String<"hello">>`, + s`tftypes.Object["greeting":tftypes.DynamicPseudoType]<"greeting":tftypes.String<"hello">>`, ) ```
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
terraform-plugin-go version
Expected Behavior
Complex types that have DynamicPseudoType elements or attributes (a map of DynamicPseudoTypes, an object with a DynamicPseudoType attribute, etc.) should be surfaced as a value with concrete, known types when unmarshaled from msgpack.
Actual Behavior
The values retain their type constraints as types, instead of the actual type. Meaning they'd still have DynamicPseudoType as their type, instead of their concrete type.
References
The text was updated successfully, but these errors were encountered: