-
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
tftypes: Allow DynamicPseudoType with known values #136
Conversation
Reference: #94 Reference: #99 Reference: #100 Reference: #128 Reference: #133 Reverts incorrect logic for handling DynamicPseudoType values in `tftypes`. This type information must be preserved when traversing the protocol, as Terraform CLI decodes values based on the schema information. If a concrete value type is used where DynamicPseudoType is expected, Terraform CLI will return errors such as (given an object of 4 attributes, when DynamicPseudoType is expected): ``` │ Error: ["manifest"]: msgpack: invalid code=84 decoding array length ```
@alexsomesan it seems to work as expected on the terraform-provider-kubernetes
But please reach out if it doesn't. $ terraform apply
╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│ - bflad/framework in /Users/bflad/go/bin
│ - hashicorp/awscc in /Users/bflad/go/bin
│ - hashicorp/corner in /Users/bflad/go/bin
│ - hashicorp/hashicups in /Users/bflad/go/bin
│ - hashicorp/kubernetes in /Users/bflad/go/bin
│ - hashicorp.com/edu/hashicups in /Users/bflad/go/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# kubernetes_manifest.test-configmap will be created
+ resource "kubernetes_manifest" "test-configmap" {
+ manifest = {
+ apiVersion = "v1"
+ data = {
+ foo = "bar"
}
+ kind = "ConfigMap"
+ metadata = {
+ labels = {
+ app = "test-app"
+ environment = "production"
}
+ name = "test-config"
+ namespace = "default"
}
}
+ object = {
+ apiVersion = "v1"
+ binaryData = (known after apply)
+ data = {
+ "foo" = "bar"
}
+ immutable = (known after apply)
+ kind = "ConfigMap"
+ metadata = {
+ annotations = (known after apply)
+ clusterName = (known after apply)
+ creationTimestamp = (known after apply)
+ deletionGracePeriodSeconds = (known after apply)
+ deletionTimestamp = (known after apply)
+ finalizers = (known after apply)
+ generateName = (known after apply)
+ generation = (known after apply)
+ labels = (known after apply)
+ managedFields = (known after apply)
+ name = "test-config"
+ namespace = "default"
+ ownerReferences = (known after apply)
+ resourceVersion = (known after apply)
+ selfLink = (known after apply)
+ uid = (known after apply)
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
kubernetes_manifest.test-configmap: Creating...
kubernetes_manifest.test-configmap: Creation complete after 0s
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. |
It works! I've tested this with
|
Excellent! Going to pull this in today and hopefully we can release v0.6.0 with this 🔜 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Reference: #94
Reference: #99
Reference: #100
Reference: #128
Closes #133
Reverts incorrect logic for handling DynamicPseudoType values in
tftypes
. This type information must be preserved when traversing the protocol, as Terraform CLI decodes values based on the schema information. If a concrete value type is used where DynamicPseudoType is expected, Terraform CLI will return errors such as (given an object of 4 attributes, when DynamicPseudoType is expected):