aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go
diff options
context:
space:
mode:
authorAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
committerAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
commit15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch)
tree255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go
parent07971ca38143c5faf951d152fba370ddcbe26ad5 (diff)
downloadterraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go
index 1660a67..b80b223 100644
--- a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go
+++ b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go
@@ -126,6 +126,8 @@ func addrToSchema(addr []string, schemaMap map[string]*Schema) []*Schema {
126 switch v := current.Elem.(type) { 126 switch v := current.Elem.(type) {
127 case ValueType: 127 case ValueType:
128 current = &Schema{Type: v} 128 current = &Schema{Type: v}
129 case *Schema:
130 current, _ = current.Elem.(*Schema)
129 default: 131 default:
130 // maps default to string values. This is all we can have 132 // maps default to string values. This is all we can have
131 // if this is nested in another list or map. 133 // if this is nested in another list or map.
@@ -249,11 +251,10 @@ func readObjectField(
249} 251}
250 252
251// convert map values to the proper primitive type based on schema.Elem 253// convert map values to the proper primitive type based on schema.Elem
252func mapValuesToPrimitive(m map[string]interface{}, schema *Schema) error { 254func mapValuesToPrimitive(k string, m map[string]interface{}, schema *Schema) error {
253 255 elemType, err := getValueType(k, schema)
254 elemType := TypeString 256 if err != nil {
255 if et, ok := schema.Elem.(ValueType); ok { 257 return err
256 elemType = et
257 } 258 }
258 259
259 switch elemType { 260 switch elemType {